Setting for CREATE/ALTER proc instead of sp_Executesql?
gwood
Posts: 2
Hi all
Have used earlier version SQL Compare in the past, and know that it generated Create/Alter proc statements in "native" format - straight Create and Alter commands.
Testing V11 is generating these commands within "red code", using sp_executesql.
i.e.
IF OBJECT_ID(N'[Archive].[MYProc]', 'P') IS NOT NULL
EXEC sp_executesql N'
ALTER Procedure [Archive].[MYProc] . . . .
END
'
Would like to have the script default to
IF OBJECT_ID(N'[Archive].[MYProc]', 'P') IS NOT NULL
ALTER Procedure [Archive].[MYProc] . . . .
END
Don't see an option to make this happen. AM I missing it?
Thanks
Have used earlier version SQL Compare in the past, and know that it generated Create/Alter proc statements in "native" format - straight Create and Alter commands.
Testing V11 is generating these commands within "red code", using sp_executesql.
i.e.
IF OBJECT_ID(N'[Archive].[MYProc]', 'P') IS NOT NULL
EXEC sp_executesql N'
ALTER Procedure [Archive].[MYProc] . . . .
END
'
Would like to have the script default to
IF OBJECT_ID(N'[Archive].[MYProc]', 'P') IS NOT NULL
ALTER Procedure [Archive].[MYProc] . . . .
END
Don't see an option to make this happen. AM I missing it?
Thanks
Comments
If you turn off the 'Add object existence checks' option, you'll get the straight CREATE/ALTER behaviour back.
Redgate Software