Automatically generate DROP <OBJECT TYPE> IF EXISTS statement
In a SQL script, I create several schemas, tables, and procedures. I'd like to have the ability to right-click an object name (in the editor), and select something like "Generate DROP IF EXIST".
The tool would understand the object type and automatically add the following to the top of the file:
DROP PROCEDURE IF EXISTS <SchemaName1.ProcName1>
DROP PROCEDURE IF EXISTS <SchemaName2.ProcName2>
DROP TABLE IF EXISTS <SchemaName1.TableName1>
DROP TABLE IF EXISTS <SchemaName2.TableName2>
GO
DROP SCHEMA IF EXISTS <SchemaName1>
DROP SCHEMA IF EXISTS <SchemaName2>
13
votes
Andrey Langovoy
shared this idea