there is always something to develop
How to check if temporary table exists
To test existence of temporary table we have to use OBJCECT_ID function that gives us ID of the object or NULL if object does not exist. We have to remeber that temporary table are always placed on tempdb database.
IF OBJECT_ID('tempdb..#temp') IS NOT NULL begin drop table #temp end
See also
Comments
"It's choice - not chance - that determines your destiny."
You are 4599 reader
since 1st April 2009
Yes | 100.0% |
1 |
No | 0 |