check for temp table exists in sql server code example
Example 1: sql server check if temp table exists
IF OBJECT_ID('tempdb..#Results') IS NOT NULL DROP TABLE #Results
Example 2: check if sql temp table exists
IF OBJECT_ID('tempdb..#Results') IS NOT NULL
Truncate TABLE #Results
else
CREATE TABLE #Results
(
Company CHAR(3),
StepId TINYINT,
FieldId TINYINT,
)