Published in: SQL
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.
SQL Cookbook
Written in O'Reilly's popular Problem/Solution/Discussion style, the SQL Cookbook is sure to please. Anthony's credo is: "When it comes down to it, we all go to work, we all have bills to pay, and we all want to go home at a reasonable time and enjoy what's still available of our days." The SQL Cookbook moves quickly from problem to solution, saving you time each step of the way.
DaveChild on 09/11/08
1 person has marked this snippet as a favorite
Published in: SQL
IF EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE table_name = 'TableToDelete') DROP TABLE TableToDelete
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