Drop If Exists Syntax

SQL Server 2016
 * https://www.mssqltips.com/sqlservertip/4402/new-drop-if-exists-syntax-in-sql-server-2016/

for a permanent table dbo.Scores you can use IF OBJECT_ID('dbo.Scores', 'U') IS NOT NULL DROP TABLE dbo.Scores; Or, for a temporary table you can use IF OBJECT_ID('tempdb.dbo.#T', 'U') IS NOT NULL DROP TABLE #T;

Other methods: if exists (select * from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'Scores' AND TABLE_SCHEMA = 'dbo') drop table dbo.Scores;