Specify the subfolder where objects are scripted when creating scripts folders from a database

jamaljamal Posts: 47 Bronze 3
A long time ago, we scripted our databases to scripts folders to add them to source control.  At the time, we told sql compare to put table triggers in their own folder and it did.  Our folder structure looks like the following and sql compare has had no problems comparing and updating it.  

Create Scripts --> 
           Functions
           Stored Procedures
           Tables
           Triggers


I need to script out a new database and would like to follow the same structure, putting Triggers into its own subfolder.  The documentation, 2nd sentence here https://documentation.red-gate.com/sc/working-with-other-data-sources/working-with-scripts-folders, indicates I can still do this.  I don't see any options in sql compare 15.3 professional UI to accomplish this.  

Does anyone know how to do it?
James

Answers

  • This was logged as a support ticket and the answer to this question is that SQL Compare doesn't actually support the output of DML triggers to an individual folder when going from Database -> Scripts folder. SQL Compare considers DML triggers to be part of a table script, so they get included in the table create scripts.

    If your scripts folder already contains both separate table scripts and DML triggers in their own sub folders, SQL Compare has the capability to identify references to the table, so SQL Compare will pick up those DML triggers and add them to the relevant table script for deployment. 

    Kind regards,

    Kurt McCormick
    Product Support Engineer, Redgate

    Need help? Take a look at our Help Center

Sign In or Register to comment.