I have received following questions numerous times:
“How to check existence of Temp Table in SQL Server Database?”
“How to drop Temp Table from TempDB?”
“When I try to drop Temp Table I get following error. Msg 2714, Level 16, State 6, Line 4
There is already an object named ‘#temp’ in the database. How can I fix it?”
“Can we have only one Temp Table or we can have multiple Temp Table?”
“I have SP using Temp Table, when it will run simultaneously, will it overwrite data of temp table?”
In fact I have already answer this question earlier in one of my blog post. I have even explained how Temp Table works in TempDB and how they are managed.
Visit my earlier written article for answers to questions listed above.
SQL SERVER – Fix : Error : Msg 2714, Level 16, State 6 – There is already an object named ‘#temp’ in the database
Reference : Pinal Dave (http://blog.SQLAuthority.com)