4 Ways to Check if a Table Exists Before Dropping it in SQL Server (T-SQL)

Dropping a table in SQL easy. You simply use DROP TABLE myTable where myTable is the name of the table you want to drop. You can use this method to drop a table in SQL Server via T-SQL script.

But you’ll get an error if the table doesn’t actually exist. That is, unless you check for the existence of the table first.

Below are four ways of using T-SQL to check whether the table exists before dropping it.

Continue reading