Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Insert SQL for multiple record

I get the error message when I run the following query in MSSQL Server 2005.

Error Message is Incorrect syntax near ','. I think query is ok. But I don't know why I get error.

INSERT INTO PERSON (ID, EMP_NAME) VALUES ('E001', 'AAA'), ('E002', 'BBB');

SQL Server does not support?

like image 987
Zaw Than oo Avatar asked Dec 12 '22 12:12

Zaw Than oo


1 Answers

If your DB is lower than SQL Server 2008

INSERT INTO PERSON (ID, EMP_NAME) VALUES ('E001', 'AAA');
INSERT INTO PERSON (ID, EMP_NAME) VALUES ('E002', 'BBB');
like image 148
Robert Avatar answered Dec 27 '22 10:12

Robert