I want to ensure if a temporary table exists in my database or not.
I tried to use OBJECT_ID()
function but it seems that I can't use it with temporary tables.
How can I resolve this problem?
Use
OBJECT_ID('tempdb..#foo')
to get the id for a temporary table when running in the context of another database.