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
OBJECT_ID()
Use this to change the context of the OBJECT_ID call to tempdb
OBJECT_ID('tempdb..#table')
OBJECT_ID on MSDN shows 3 part object names. In this case you can omit schema_name
schema_name
OBJECT_ID ( '[ database_name . [ schema_name ] . | schema_name . ]