Search this blog

Monday, June 1, 2009

Delete SQL 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