Simplify your SQL script processing.
By Kent Milligan
Best practice dictates that an SQL database creation script would have the following pair of statements duplicated for each SQL object:
DROP TABLE table1;
CREATE TABLE table1 (col1 INT, col2 CHAR(10));
The pairing of the DROP and CREATE statements is done so that the script can remove old versions of the database objects and avoid failing with an “Object Already Exists” error. The problem with this approach is the DROP statement will fail with an “Object Not Found” error the first time you try to create this database on a system or partition.