Add "if exists...drop" option for programability objects
Not everyone will want to use SQLCompare for continuous integration for various reasons. Adding an option to include an if exists...drop statement with certain types of objects means that all scripts can still be CREATE scripts while allowing for other CI implementations.
For now, you may be able to use a batch file that executes SQL and drops the objects you want re-created before using the SQL Compare Command Line API. Since the objects are dropped, the synch script will generate CREATE scripts instead of alter.
If you wanted to create everything from scratch, you could drop and recreate the database, which would generate all CREATE scripts.
I hope this helps for now.
-
SqlNightOwl commented
I'd change from a drop to a create if not exitsts and then save all scripts as ALTER OBJECT
such as:
if object_id(N'schema.procedurename', N'P') is null
exec sys.sp_executesql 'create schema.procedurename as select 1 as stub';
go
alter procedure schema.procedurenameetc.
etc.
...Keeping to an ALTER scenario will leave any security settings in place.
ALSO: keep/add the GO batch seperator as part of the script.