我想将数据插入Microsoft sql表,但在'附近遇到了错误的语法。 '

时间:2016-05-11 16:09:14

标签: sql sql-server mssql-jdbc

我一直在尝试将数据插入到Microsoft SQL表中,但它表示“'”附近的语法不正确。什么可能出错?

这是我的数据:

insert into Course_Relation
('DBA','Diploma_in_Business_Administration', 'SB' ,500.00),
('DBIT','Diploma_in_Business_and_Information_Technology','DMIT',700.00,100.00),
('DDM','Diploma_in_Digital_Media','DMIT',1000.00,900.00),
('DFI','Diploma_in_Business_Administration','SB',800.00),
('DISM','Diploma_in_Infocomm_Security_Management','DMIT',900.00,300.00),
('DIT','Diploma_in_Information_Technology','DMIT',650.00,450.00),
select * from Course_Relation

1 个答案:

答案 0 :(得分:2)

您的语法不正确,并且您必须为表构造函数中的每一行提供相同数量的列。

请参阅https://msdn.microsoft.com/en-us/library/ms174335.aspx

{{1}}