Friday, January 23, 2009

SQL: Delete Table If Exists

To Drop a table, if table exists, use the following Query



IF EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE table_name = 'TableToDelete') DROP TABLE TableToDelete

No comments:

Post a Comment