Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 batch insert

Author  Topic 

sqlnewbie
Starting Member

1 Post

Posted - 2002-01-14 : 14:34:53
I am trying to select into a table with the following statement..

Insert into table 1
(blah,
blah,
blah)

Select
blah,
blah,
blah
from table 2

I want these rows to go in one at a time, not as a batch...how do I do this? Is there a setting I can change?



robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-01-14 : 14:39:16
A. Not with that syntax and;
B. Why?

The whole point of using that syntax is so that you DON'T have to perform row-by-row INSERTs. In fact you should avoid row-by-row operations as much as possible if you are using SQL Server. It causes excess overhead and resource usage and will ALWAYS be slower than performing set-based operations.

Go to Top of Page

sica
Posting Yak Master

143 Posts

Posted - 2002-01-14 : 16:30:46
You can use a cursor to go through rows one at a time,but as robvolk says...why?

You find more information about cursors in BOL.

Sica

Go to Top of Page
   

- Advertisement -