Monday, July 16, 2007

SQL2008 Multiple Insert statement

One of the Difference between the SQL 2005 AND SQL 2008.

SQL2008 gives you the facility to insert multiple rows in a single statements.

--SQL Server 2005
INSERT dbo.EMPLOYEE(SALARY) VALUES (1000)
INSERT dbo.EMPLOYEE(SALARY) VALUES (2000)
INSERT dbo.EMPLOYEE(SALARY) VALUES (3000)
INSERT dbo.EMPLOYEE(SALARY) VALUES (4000)

--SQL Server 2008
INSERT dbo. EMPLOYEE(SALARY) VALUES (1000),(2000),(3000),(4000)

Thanks

No comments: