Groups | Blog | Home
all groups > sql server programming > december 2004 >

sql server programming : Please Advice Cursor vs Select Rowcount


Jorge Luzarraga Castro
12/29/2004 9:27:42 PM
Hello,

I need to tackle a big migration process from an old database schema to a
completely new one. As part of the migration requirements we need to divide
this process in two sub-processes:
1) To copy and translate the old data into a new temporary database´s
submodel
2) To select the data from this temporay submodel and insert them into the
new database schema.

For the every big task I´ve got to process around 100,000 records one at a
time, so my question is:


What´s the best strategy to process this resultset in terms of eficiency? A
Cursor ? or just a select with a set rowcount 1?


Thanks in advance.


Jorge Luzarraga


Ivan Arjentinski
12/30/2004 2:43:43 AM
[quoted text, click to view]
Given this explanation - cursor. But are you sure that you have to process
the data rows one-by-one? Can't you just do statements like
INSERT INTO newTable(...)
SELECT ....
FROM oldTable

You could try get some assistance on this issue here in the newsgroup. If
you want to do this you'll have to provide more details, of course.

AddThis Social Bookmark Button