Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

inserting multiple rows

Status
Not open for further replies.

alexerm

Programmer
Feb 27, 2003
17
0
0
CA
Is there way in MS SQL to insert mulptiple rows at the same time?

I'm trying to achieve something like this(I know it works in DB2):

---------------------------------
INSERT INTO mytable
(a,b)
VALUES
(1,2),
(5,4),
(15,2),
....
--------------------------------


Thanks
 
Try this

INSERT INTO #t
(a,b,c)
SELECT 1,5,15
UNION
SELECT 2,4,2


Sunil
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top