Script generation
pkettlew
Posts: 15 Bronze 1
Hello,
I am new user to SQL Source Control
I would like the scripts that are generated from SQLServer via SQL Source Control to Source Control to include drop statements for dml objects . The default seems only to script as a create without a drop
I would like something like :
Is this possible to configure this with SQL Source Control so it does ?
thanks
I am new user to SQL Source Control
I would like the scripts that are generated from SQLServer via SQL Source Control to Source Control to include drop statements for dml objects . The default seems only to script as a create without a drop
I would like something like :
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[DIF].[usp_GetBookList]') AND type IN (N'P', N'PC')) DROP PROCEDURE [DIF].[usp_GetBookList] GO CREATE PROCEDURE [DIF].[usp_GetBookList] AS
Is this possible to configure this with SQL Source Control so it does ?
thanks
Comments
You can replace the default scripts by using the Migrations feature in SQL Source Control.
Please see below for more information:
http://documentation.red-gate.com/displ ... on+scripts
Thank you,
Product Support Engineer
Redgate Software Ltd
Please see our Help Center for detailed guides on how to use our tools
Thanks for this.
Your suggestion is for Migration Scripts only , I need the script that gets saved into CVS to have a drop / create . Is this possible ?
Thanks
No, the only way to do this is to use Migration scripts.
However if an object with the same definition on the VCS already exists on a target database linked SQL Source Control, the tool will not attempt to create it.
Thank you,
Product Support Engineer
Redgate Software Ltd
Please see our Help Center for detailed guides on how to use our tools