| Code to check and delete temporary table
Below is the code to check and delete the temporary table
IF object_id('tempdb..##temptable') IS NOT NULL
BEGIN
DROP TABLE ##temptable
PRINT 'Temp table is deleted'
END
Else
BEGIN
PRINT 'Temp table not exists'
END
| | |