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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is it possible to insert multiple records with ONE insert?

Status
Not open for further replies.

Sina

Technical User
Jan 2, 2001
309
CA
Hello everyone,

Is it possible to insert several records with one insert statement in SQL server 7 and or 2000?

Basically instead of inserting every record with one insert in to table A, I wanted to know if I can write the insert statement in a way, so that I could insert multiple records with one insert.

i.e I have one million records that I have to insert everyso often. but it takes a long time with the insert per each record.

Thank you all.

 
Where do you get the data for the INSERT. If it is from another SQL database you can use a SELECT statements else create a DTS Package. I do recommend that you create a DTS package anyway and maybe schedule it to run when your server is not busy: eg. 24h00
 
If this file is a fixed set of data (non changing) & is not available from another database, it might be worth setting a file up in a format suitable for bcp/dts (eg csv)& using that to pull in the data.

Can you give us more details of your code?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top