configuration for "modeling" the scripts

AlineAline Posts: 18
edited September 2, 2009 10:19AM in SQL Compare Previous Versions
Hello

What I need is a configuration with which I can determine how the script should look like.

For example:
I'd like to have:
IF NOT EXISTS 
    (SELECT * FROM sys.objects WHERE OBJECT_ID = OBJECT_ID(N'[<SchemaName,,>].[<SPName,,>]')AND TYPE IN (N'P', N'PC'))
    EXEC sp_executesql N'CREATE PROCEDURE [<SchemaName,,>].[<SPName,,>] 
    AS 
    BEGIN 
        SET NOCOUNT ON;
    END'
GO

ALTER PROCEDURE [<SchemaName,,>].[<SPName,,>]
-- parameterlist
AS
    --stored procedure code
GO

instead of:
CREATE PROCEDURE [<SchemaName,,>].[<SPName,,>] 
-- parameterlist
AS 
    BEGIN 
       --stored procedure code
    END
GO

I need this for all "code objects" like stored procedures, functions, etc.
The reason is first, with drop/create some dependencies are lost. And second, I already have missing dependencies. But with this, they would be healed within 2 script executions.

Is there a way for doing this??

Thanks for your help in advance.
Aline

Comments

  • Brian DonahueBrian Donahue Posts: 6,590 New member
    Hello Aline,

    There is no control over the way that SQL Compare formats the code that it produces, although I agree it would be interesting to combine SQL Prompt layout and SQL Compare scripting.

    Using IF EXISTS...DROP has been a request that has been around for awhile. It's still a feature request at this point though, sorry to say. (SC-2909)
Sign In or Register to comment.