Drop statement in script
Would be nice to have the option to include the drop statement inside of each object script. The option would be global over all scripts.
EX: IF (OBJECT_ID('MyTable') IS NOT NULL) DROP TABLE MyTable
-
Ed White commented
I use that script a lot.
An annoyance in SQL Prompt is that when I type OBJECT_ID and click on the pulldown prompt suggestion for OBJECT_ID, SQL Prompt inserts brackets [ ] around it, resulting in [OBJECT_ID] (I have to option turned on to automatically put brackets around column names). The resulting script
IF ([OBJECT_ID]('MyTable') IS NOT NULL) DROP TABLE MyTable`
gives an error--you can't have brackets around OBJECT_ID. So every time I type this, I have to either manually type the entire word OBJECT_ID, or manually remove the brackets.