August 5, 2009 at 2:26 pm
I have a table with 70+ Million rows in it. We added a uniqueidentifier column to the end of it. All NULL values to start. So far, so good. We want to insert a GUID into all 70 million rows of this table, using the NEWID() function.
I started off using a Cursor with FAST_FORWARD to Update each row based on the Primary Key value (I know, this isn't the most optimal way of doing things), it ran through roughly 15 million rows in 5 hours before getting extremely, EXTREMELY slow. The table is large (50 or so columns of text, varchar, int, etc.) but I'm unsure why the cursor basically stopped working.
It now updates a single row every few minutes. I can stop and start the cursor just fine, but it always resumes at the same rate of update. I have also tried using a While Loop to achieve the same results, and that is just as slow. What am I missing here?
August 5, 2009 at 2:41 pm
Am I missing something?
Won't this work?
update tableName set columnName = newid()
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply