Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
sqlguru
SQLTeam CoFounder
20 Posts |
Posted - 2000-08-09 : 00:00:00
|
Alex L writes "I know that we can use information_schema.tables and If exists (....) to check for the existence of a table. How can I do the same thing for a temporary table, which exists in tempdb? I work with SQLserver 7.0 and Windows NT 4.0."Alex,My favorite method is to use something like the following:IF object_id("tempdb..foo") is not nullBEGIN --stuff to do if table exists --object_id returns a non-null value if the object existsENDhope this helps, Sean |
|
|
|
|