Improved INSERT statement in SQL Server 2008

I have written few articles about different types of INSERT statement in SQL Server, SQL Server 2008 came up with many enhancements in T-SQL and developer convenience. There is one enhancement in the way you use INSERT statement.

This new feature called “Raw Constructor” which will be helpful to specify more than one raw in VALUE clause of INSERT statement.

CREATE TABLE emps

(

Name VARCHAR(50),

Dept VARCHAR(10),

Company VARCHAR(15)

)

 

–INSERT records with multiple RAW in VALUE clause

INSERT INTO emps (Name,Dept,Company) VALUES

(‘Ritesh’,‘MIS’,‘chem’),

(‘Bihag’,‘MIS’,‘chem’),

(‘Rajan’,‘acct’,‘mar’)

 

Reference: Ritesh Shah
http://www.sqlhub.com
Note: Microsoft Books online is a default reference of all articles but examples and explanations prepared by Ritesh Shah, founder of
http://www.SQLHub.com

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: