Options

How apply script and synchronize db in one go

Nehal.ShahNehal.Shah Posts: 13
edited March 26, 2009 8:28AM in SQL Compare Previous Versions
Hi,

I have 2 versions of code say v1.1 and v1.2 and hence 2 db.
Whenevener i have to upgrade any site from v1.1 to v1.2 i have to do following steps:
(1) Apply script to db through query analyser (pre-compare),
(2) Compare & synchronize db with template one using SQL Compare and
(3) Again apply script to db through query analyser (post-compare).

How can i achieve this in one go?

If anything not clear feel free to ask.

Regards
Nehal[/b]

Comments

  • Options
    Nehal.Shah wrote:
    Hi,

    I have 2 versions of code say v1.1 and v1.2 and hence 2 db.
    Whenevener i have to upgrade any site from v1.1 to v1.2 i have to do following steps:
    (1) Apply script to db through query analyser (pre-compare),
    (2) Compare & synchronize db with template one using SQL Compare and
    (3) Again apply script to db through query analyser (post-compare).

    How can i achieve this in one go?

    If anything not clear feel free to ask.

    Regards
    Nehal[/b]

    There is no way to do this currently in SQL Compare, however the concept of pre- and post-synchronization scripts is one that we're actively considering. Could you let us know what sort of operations you need to perform before and after the synchronization script? If you have examples you could email me, that would be great.

    David Atkinson
    Red Gate Software
    David Atkinson
    Product Manager
    Redgate Software
  • Options
    Normally script is used to update column name, add some values etc.

    e.g. of the script applied after SQL compare is as
    */
    IF ((SELECT COUNT(1) FROM DocumentNumberComponent) = 0 )
    BEGIN

    INSERT INTO [dbo].[DocumentNumberComponent]([Component],
    [Code],[Active]) VALUES( 'D Rer','DR',1)
    INSERT INTO [dbo].[DocumentNumberComponent]([Component],[Code],[Active]) VALUES( 'Doc Category','DC',1)
    INSERT INTO [dbo].[DocumentNumberComponent]([Component],[Code],[Active]) VALUES( 'Proj Ref','PR',1)
    INSERT INTO [dbo].[DocumentNumberComponent]([Component],[Code],[Active]) VALUES( 'Publis Co','PC',1)
    INSERT INTO [dbo].[DocumentNumberComponent]([Component],[Code],[Active]) VALUES( 'S W P','WP',1)

    END

    Many such scripts are applied after and before SQL Compare.
Sign In or Register to comment.