SQL Server 2008 New Feature – Insert Statement Supports Multiple Record

August 7th, 2008 | Posted by Vidya Vrat in SQL Server

With SQL Server 2008, we have got an interesting enhancement in Insert statement.

Originally from previous releases of SQL Server until SQL Server 2005, an INSERT statement was supposed to accept set of values for one row/record at a time.

INSERT INTO Customers (Name,Qty,Price)
Values(‘A’,2,12)

INSERT INTO Customers (Name,Qty,Price)
Values(‘B’,3,24)

But with SQL Sever 2008, we can insert multiple rows/records at a time just separated by comma as a delimiter:

INSERT INTO Customers (Name,Qty,Price)
Values(‘A’,2,12),(‘B’,3,24)

This will help the developers to save their time while inserting data.

You can follow any responses to this entry through the RSS 2.0 You can leave a response, or trackback.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.