September 19, 2017 at 12:07 pm
Today I got notified that we were getting errors on a stored procedure. Recently, I made some performance improvements to it and included a filtered index for a temp table. Apparently, that started causing an error which is described in here: https://connect.microsoft.com/SQLServer/feedback/details/670808/filtered-index-on-a-temp-table-in-a-stored-proc-can-result-in-a-error-602
Does someone knows if this issue is solved on any hotfix/CU/SP for 2008 R2?
I found that there was a fix for 2012 and 2014, but nothing for previous versions.
September 19, 2017 at 2:53 pm
Dumb question, do you drop the temp table before exiting the procedure or just let it go out of scope? I read the connect item and the code there just lets the temp table go out of scope, unless I missed the drop table.
September 19, 2017 at 3:07 pm
Lynn Pettis - Tuesday, September 19, 2017 2:53 PMDumb question, do you drop the temp table before exiting the procedure or just let it go out of scope? I read the connect item and the code there just lets the temp table go out of scope, unless I missed the drop table.
I just let it go out of scope. I guess it wouldn't hurt to drop it and see if that helps.
Thank you.
September 19, 2017 at 4:10 pm
Luis Cazares - Tuesday, September 19, 2017 3:07 PMLynn Pettis - Tuesday, September 19, 2017 2:53 PMDumb question, do you drop the temp table before exiting the procedure or just let it go out of scope? I read the connect item and the code there just lets the temp table go out of scope, unless I missed the drop table.I just let it go out of scope. I guess it wouldn't hurt to drop it and see if that helps.
Thank you.
Let us know. I have always tried (may not succeed) to drop temporary tables that I create in a stored procedure. There have been discussions that doing so slows down the procedure but it just makes sense to me to try and do it.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy