How to Insert Multiple Records In MSSqlserver 2008

CREATE TABLE TBEMP(ID INT,NAME VARCHAR(20))

DROP TABLE TBEMP

INSERT INTO TBEMP(ID,NAME) SELECT 2,’Project A’ UNION ALL
SELECT 4,’Project B’ UNION ALL SELECT 6,’Project C’ UNION ALL
SELECT 9,’Project D’

INSERT INTO TBEMP(ID,NAME) values(11,’Project B’),(16,’Project C’),(19,’Project D’)

SELECT *FROM TBEMP

Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

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