SQL Server DROP TABLE IF EXISTS Examples
www.mssqltips.com › sqlservertip › 6769Mar 23, 2021 · Option 1 - DROP TABLE if exists using OBJECT_ID() function (all supported versions) Using OBJECT_ID() will return an object id if the name and type passed to it exists.. In this example we pass the name of the table and the type of object (U = user table) to the function and a NULL is returned where there is no record of the table and the DROP TABLE is ignored.