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 |
|
hadoft
Starting Member
20 Posts |
Posted - 2005-07-20 : 06:40:28
|
| hisome times I need to declare a KeySet(or Dynamic) cursor, to make it sensitive to the rows updates while looping.-the updates are done in the loop by seprate upadte statments not using (current of )-but according to the cursor SELECT STATMENT, it may be implicitily converted into a STATIC cursor, so it will not fetch the updated version of the datais there any way to detect that this conversion has happened?and how to discover the final mode of the cursor? , is it realy KeySet or it has been converted implicitily into STATIC@@error didn't give any helpthanks. |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2005-07-20 : 08:21:06
|
| Well, since you're using a separate UPDATE already, why not get rid of the cursor entirely? |
 |
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2005-07-20 : 10:31:57
|
| The vast majority of cursor implementations are not necessary. The objectives can almost always be accomplished with set based processing. (probably what Rob is implying)However, assuming you're committed to processing your records one at a time and are concerned that your cursor is not dynamic, a while loop (rather than a cursor) should solve that issue.select current values for each loop iteration. It will also relieve possible locking issues caused by your cursor.Be One with the OptimizerTG |
 |
|
|
hadoft
Starting Member
20 Posts |
Posted - 2005-07-20 : 12:02:56
|
thanks for the suggestionsbut is there an answer to my initial questionis there is any way to know that this cursor is working as STATIC instead of DYNAMIC |
 |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2005-07-20 : 22:43:09
|
| No, and if you get rid of the cursor, the question becomes moot. |
 |
|
|
|
|
|