Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
A cursor already exists
Message
 
 
To
05/03/2008 09:30:04
General information
Forum:
Microsoft SQL Server
Category:
Other
Miscellaneous
Thread ID:
01298878
Message ID:
01298881
Views:
16
This message has been marked as a message which has helped to the initial question of the thread.
>I have this script that I run on a regular basis. I have a DECLARE tableIndexes CURSOR FOR that is inserted at several places in the script. But, if the script didn't run well on the last time, when I run the script again, I might have this error:
>
>"A cursor with the name 'tableIndexes' already exists."
>
>How can I make sure all cursor are cleaned before I start running the script.

Check DEALLOCATE command in BOL.

DEALLOCATE @MyCursor
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform