How to determine if a SQL temp table exists

by Andrew Jackson 12. September 2009 11:55
IF OBJECT_ID('tempdb..#some_temp_name') IS NOT NULL
PRINT '#some_temp_name exists.'
ELSE
PRINT '#some_temp_name does not exist.'

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Development | SQL

Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen