How to generate script that includes schema and static data

jnikjnik Posts: 4 Bronze 1
Is there a way in the SQL COmpare UI to create a deployment script that includes schema and static data?

Best Answer

  • squigleysquigley Posts: 220 Gold 1
    There isn't actually a way to do it within the graphical user interface, but it's possible to do it using the command line interface using the command line.

    Here's the full documentation on using the command line interface - https://documentation.red-gate.com/sc13/using-the-command-line

    An example for Static Data: switch /include:"StaticData". 

    So for instance, if I wanted to compare a scripts folder with a database and generate a deployment script including the static data, I would save a project file containing the source and target of the comparison and then use the following command line

    "C:\Program Files (x86)\Red Gate\SQL Compare 13\sqlcompare.exe" /project:"c:\path\myProject.scp" /scriptfile:"deploymentScript.sql" /include:"StaticData"

    If I wanted to perform the deployment at the same time then I would add /sync to the end of the command line.

    Sean Quigley | Product Support Engineer | Redgate Software

    Have you visited our Help Center?





Answers

  • squigleysquigley Posts: 220 Gold 1
    There isn't actually a way to do it within the graphical user interface, but it's possible to do it using the command line interface using the command line.

    Here's the full documentation on using the command line interface - https://documentation.red-gate.com/sc13/using-the-command-line

    An example for Static Data:
     
    switch /include:"StaticData". 

    So for instance, if I wanted to compare a scripts folder with a database and generate a deployment script including the static data, I would save a project file containing the source and target of the comparison and then use the following command line

    "C:\Program Files (x86)\Red Gate\SQL Compare 13\sqlcompare.exe" /project:"c:\path\myProject.scp" /scriptfile:"deploymentScript.sql" /include:"StaticData"

    If I wanted to perform the deployment at the same time then I would add /sync to the end of the command line.

    Sean Quigley | Product Support Engineer | Redgate Software

    Have you visited our Help Center?





  • squigleysquigley Posts: 220 Gold 1
    There isn't actually a way to do it within the graphical user interface, but it's possible to do it using the command line interface using the command line.

    Here's the full documentation on using the command line interface - https://documentation.red-gate.com/sc13/using-the-command-line

    An example for Static Data: switch /include:"StaticData". 

    So for instance, if I wanted to compare a scripts folder with a database and generate a deployment script including the static data, I would save a project file containing the source and target of the comparison and then use the following command line

    "C:\Program Files (x86)\Red Gate\SQL Compare 13\sqlcompare.exe" /project:"c:\path\myProject.scp" /scriptfile:"deploymentScript.sql" /include:"StaticData"

    If I wanted to perform the deployment at the same time then I would add /sync to the end of the command line.

    Sean Quigley | Product Support Engineer | Redgate Software

    Have you visited our Help Center?





  • squigleysquigley Posts: 220 Gold 1
    There isn't actually a way to do it within the graphical user interface, but it's possible to do it using the command line interface using the command line.

    Here's the full documentation on using the command line interface - https://documentation.red-gate.com/sc13/using-the-command-line

    An example for Static Data:
     
    switch /include:"StaticData". 

    So for instance, if I wanted to compare a scripts folder with a database and generate a deployment script including the static data, I would save a project file containing the source and target of the comparison and then use the following command line

    "C:\Program Files (x86)\Red Gate\SQL Compare 13\sqlcompare.exe" /project:"c:\path\myProject.scp" /scriptfile:"deploymentScript.sql" /include:"StaticData"

    If I wanted to perform the deployment at the same time then I would add /sync to the end of the command line.

    Sean Quigley | Product Support Engineer | Redgate Software

    Have you visited our Help Center?





  • jnikjnik Posts: 4 Bronze 1
    Thanks squigley!  That is what I was finding as well, but wanted to make sure.  The command line will really help though.  Thanks again!
Sign In or Register to comment.