Cursor in t-SQL

Discussion in 'Software' started by be0, Oct 27, 2008.

  1. be0

    be0 Corporal

    Hi Fellas,

    I have this function in T-SQL SQL Server 2005. Now I created this cursor in it. There is one element within the while loop that once result is found it exits the while loop and calls the return result statement.

    I forgot to include the close cursor and deallocate cursor statements here.

    Just out of curiosity what happens to this cursor everytime i exit this loop?
     
  2. PC-XT

    PC-XT Master Sergeant

    Here is a quote from http://techahead.wordpress.com/
    I think once the server is restarted, any degraded resources are put right again.

    If you don't close it, you may not be able to open it again.
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds