A local #temp table cannot exist at the start of a stored procedure calling it. IT isn;t in scope until you creat it within the stored porcedure and each user running the procedure creates their own version. You only need to check for global temp tables (those starting with ##).
Of course table variables are generally more efficient, although they can do everything a temp table can.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.