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.
| Author |
Topic |
|
gwhiz
Yak Posting Veteran
78 Posts |
Posted - 2001-05-08 : 15:20:27
|
| Can someone help me replace this cursor. I have looked at it but don't see a way of replacing it. This stored procedure updates 2 million row and takes 4 hours to run.ThanksCREATE PROCEDURE SP_SPECRUL_FILL_CDC as Declare @CDCFill int Declare @CDC int Declare @cur_id int Declare curs_cdc cursor FAST_FORWARD For Select rule_key_number, rule_cdc From temp_specrul order by rule_key_number Set NoCount ON Select @CDCFill = 0 Open curs_cdc Fetch curs_cdc into @cur_id, @CDC While @@Fetch_Status = 0 BEGIN IF @CDC is NULL Begin update temp_specrul set rule_cdc = @CDCFill where rule_key_number = @cur_id End ELSE set @CDCFill = @CDC Fetch curs_cdc into @cur_id, @CDC END Close curs_cdc Deallocate curs_cdc Set NoCount OffGO |
|
|
|
|
|