Ignore certain stored procedure in sql compare deployment script

Shailendra24Shailendra24 Posts: 2 New member
edited March 29, 2023 7:34AM in SQL Compare
Hi,

I am using SQL compare to generate script for deployment. There is 1 scenario where I have 4-5 custom stored procedure in 1 of the client database which were needed but they are not there in the source repo. When I generate the deployment script it generates the script for dropping of these 4-5 stored procedures.

Is there any way to ignore certain procedures/tables in deployment script?
Tagged:

Answers

  • Hi @Shailendra24

    Thanks for reaching out to us regarding this.

    Yes, you can ignore specific objects from appearing in the deployment script. For example, in the SQL Compare UI you can select on those objects you want to deploy, or you can apply filters to exclude specific objects.

    Are you using the SQL Compare UI, or the command line for this?


    Kind regards

    Dan Jary | Redgate Software
    Have you visited our Help Center?
  • Shailendra24Shailendra24 Posts: 2 New member
    Dan_J said:
    Hi @Shailendra24

    Thanks for reaching out to us regarding this.

    Yes, you can ignore specific objects from appearing in the deployment script. For example, in the SQL Compare UI you can select on those objects you want to deploy, or you can apply filters to exclude specific objects.

    Are you using the SQL Compare UI, or the command line for this?


    Hi @Dan,

    I am using command line for this. On UI its never an issue. I am using command line which generates the script and deploy to the database automatically. Right now I have to manually deleted some part from script which is not ideal scenario. If there is any way to do that in command line that would be great. Some command which allows custom filter to exclude objects being comapred.
  • Dan_JDan_J Posts: 460 Silver 2
    Hi @Shailendra24

    Thanks for your reply on this, and for confirming you are using the command line.

    You can use the following command to exclude stored procedures (and other objects) from the comparison by the name of the object:

    sqlcompare /db1:WidgetStaging /db2:WidgetProduction /exclude:storedprocedure:Widget*

    This is outlined in the following documentation page: https://documentation.red-gate.com/sc/using-the-command-line/switches-used-in-the-command-line#:~:text=To exclude specific objects, use a regular expression

    You can also do the same in the SQL Compare UI. You can apply the necessary filters to exclude a particular object(s) by it's name, save the filters as a .scpf file and reference the file in your command.

    I hope this helps!



    Kind regards

    Dan Jary | Redgate Software
    Have you visited our Help Center?
Sign In or Register to comment.