Monday, May 17, 2010

SQL - Insert Multiple Records into one tables at one time

How are you going to insert multiple records into a table at one time?

Here is the code you can do that:

Insert into Table
(Column1, Column2, Column3)

select Value01, Value02, Value03
Union ALL

select Value11, Value12, Value13
Union ALL

select Value21, Value22, Value23

It works and save time by avoiding multiple insert scripts.

No comments:

Post a Comment