DECLARE some_cur CURSOR FOR -- Do whatever you want CLOSE some_cur DEALLOCATE some_cur |
Thursday, 23 August 2007
T-SQL Cursor syntax
I've been asked a few times about the cursor syntax (and actually myself have been forgetting too). I know the SQL books online has syntax for everything, but apparently it is a bit hard to read some times. Anyway, post this here so it's handy for myself and the others. :)
Subscribe to:
Post Comments (Atom)
Thank you, this post saved me a lot of time. :-)
ReplyDeleteThanks, your post was exactly what i needed. easy, simple and to the point. :)
ReplyDeleteVery Good Post, i thought i knew how to use Cursors , until i met a very complex scenario and i realized that it has been long since i used them , i cant even remember the sequence and i looked dumber.
ReplyDeleteThanks for sharing