Check for existence before dropping

suggest change

DROP TABLE IF EXISTS is widely supported:

DROP TABLE IF EXISTS MyTable;

This procedural check is SQL Server syntax:

IF EXISTS(SELECT * FROM Information_Schema.Tables
          WHERE Table_Schema = 'dbo'
            AND Table_Name = 'MyTable')
  DROP TABLE dbo.MyTable

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents