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 :

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
pkettlew
0

Comments

3 comments

  • Sergio R
    Hi,

    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,
    Sergio R
    0
  • pkettlew
    Hi,

    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
    pkettlew
    0
  • Sergio R
    Hi,

    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,
    Sergio R
    0

Add comment

Please sign in to leave a comment.