DROP TABLE IF EXISTS vs OBJECT_ID IS NOT NULL

Viewed 7069

When I create a temporary table, I usually make sure that if they exist, I drop them.

IF OBJECT_ID(N'tempdb..#tempTable') IS NOT NULL
    DROP TABLE #tempTable

I recently realized that the following method does the same:

DROP TABLE IF EXISTS #tempTable

Is there one way better than the other ?

1 Answers
Related