在SQL 2014 Management Studio中更新表

问题描述 投票:0回答:1

<< img src =“ https://image.soinside.com/eyJ1cmwiOiAiaHR0cHM6Ly9pLnN0YWNrLmltZ3VyLmNvbS93Mnd6dS5wbmcifQ==” alt =“在此处输入图像描述”>

我有一个名为“ Classes”的表,并且collum是ClassID,ClassCode,ClassName,Description,并且在尝试向其中插入值的地方,我得到了错误信息

Msg 102,第15级,状态1,第3行“会计”附近的语法不正确。消息911,第16级,州1,第3行数据库“帐户”不存在。确保正确输入名称。

我对SQL还是陌生的,我很难在这里弄清楚我做错了什么。

我尝试重新键入以匹配我在演讲中写下的示例,但我似乎无法正确地做到这一点。

INSERT INTO Classes (ClassCode, ClassName, Description)
VALUES (‘ACCT306’, Accounting 1’, This course introduces accounting concepts and explores the accounting environment. It covers the basic structure of accounting, how to maintain accounts, use account balances to prepare financial statements, and complete the accounting cycle. It also introduces the concept of internal control and how to account for assets.’)

我只需要为此内容更新ClassCode,ClassName和Description列,我可以做更多的工作,但是在这一方面的帮助下,它应该会在以后为我提供更多帮助,所以我可以知道我在这里做错了,谢谢。

sql datatables updating
1个回答
0
投票

看来您是在文字处理程序中而不是在标准文本编辑器中键入查询。我认为是这种情况,因为您的报价正像‘ACCT306’而不是'ACCT306'一样变为“开引号”和“闭引号”。尝试使用简单的文本编辑器。在Windows中,我喜欢“ Notepad ++”,可以在这里找到:

https://notepad-plus-plus.org/

或使用任何简单的文本编辑器(记事本),或直接在SSMS中键入内容,而不是剪切和粘贴。您的查询应类似于:

    INSERT INTO Classes (ClassCode, ClassName, Description)
    VALUES ('ACCT306', 'Accounting 1', 'This course introduces accounting concepts and explores the accounting environment. It covers the basic structure of accounting, how to maintain accounts, use account balances to prepare financial statements, and complete the accounting cycle. It also introduces the concept of internal control and how to account for assets.')
© www.soinside.com 2019 - 2024. All rights reserved.