/ Published in: SQL
Expand |
Embed | Plain Text
IF EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE table_name = 'TableToDelete') DROP TABLE TableToDelete
Comments
Subscribe to comments
You need to login to post a comment.

DROP TABLE IF EXISTS
TableToDelete-- http://dev.mysql.com/doc/refman/5.1/en/drop-table.html
also useful for testing temp table queries
If Object_Id('tempdb..#easyResults') IS NOT NULL BEGIN DROP TABLE #easyResults END