添加多行在 Microsoft SQL Server 2012 中仍然有效吗?
Adding multiple rows still works in Microsoft SQL Server 2012?
在 Microsoft SQL Server 2012 中添加多行仍然有效?
INSERT INTO mahpl (Emp_id, num, roll_no)
VALUES (98, 14, 24), (88, 45, 46);
我收到一个错误:
Msg 102, Level 15, State 1, Line 3
Incorrect syntax near ','.
但是当我对这个查询进行同样的尝试时,它工作得很好
INSERT INTO mahpl (Emp_id, num, roll_no)
VALUES (98, 14, 24);
有人可以帮我解决这个问题吗?我需要使用单个查询添加多行
版本详情:
Microsoft SQL Server Management Studio 11.0.2100.60
Microsoft Data Access Components (MDAC) 6.1.7601.17514
Microsoft MSXML 3.0 5.0 6.0
作为 SELECT @@VERSION
的输出
Microsoft SQL Server 2005 - 9.00.3042.00 (Intel X86)
Express Edition on Windows NT 6.1 (Build 7601: Service Pack 1)
清楚地告诉你 - 你可能有 SQL Server Management Studio 2012 但你 运行 反对 SQL 服务器 2005 数据库引擎。
在这种情况下,SSMS 版本无关;重要的是您 运行 反对的 数据库引擎 版本。 SQL Server 2005 不 支持多个 VALUES
元组。您需要 运行 对抗 SQL 服务器 2008 或更新....
在 Microsoft SQL Server 2012 中添加多行仍然有效?
INSERT INTO mahpl (Emp_id, num, roll_no)
VALUES (98, 14, 24), (88, 45, 46);
我收到一个错误:
Msg 102, Level 15, State 1, Line 3
Incorrect syntax near ','.
但是当我对这个查询进行同样的尝试时,它工作得很好
INSERT INTO mahpl (Emp_id, num, roll_no)
VALUES (98, 14, 24);
有人可以帮我解决这个问题吗?我需要使用单个查询添加多行
版本详情:
Microsoft SQL Server Management Studio 11.0.2100.60
Microsoft Data Access Components (MDAC) 6.1.7601.17514
Microsoft MSXML 3.0 5.0 6.0
作为 SELECT @@VERSION
Microsoft SQL Server 2005 - 9.00.3042.00 (Intel X86)
Express Edition on Windows NT 6.1 (Build 7601: Service Pack 1)
清楚地告诉你 - 你可能有 SQL Server Management Studio 2012 但你 运行 反对 SQL 服务器 2005 数据库引擎。
在这种情况下,SSMS 版本无关;重要的是您 运行 反对的 数据库引擎 版本。 SQL Server 2005 不 支持多个 VALUES
元组。您需要 运行 对抗 SQL 服务器 2008 或更新....