How to include 'IF EXISTS' in Script Folder Generation?
yshteyman
Posts: 4 Bronze 1
I am trying to generate DDL using 'Create Scripts Folder' menu in Compare 10.2. My defaults shows checks for this option, but when I open separate script for each table in their folders it doesn't have this clause. My question is how to include it not only in deployment script but when I also generate table folder. If this is not possible how then I can create separate file for each table using synch wizard.
Thank you for your help.
Yulia
Thank you for your help.
Yulia
Yulia
Comments
I'm afraid neither are possible with the current version.
The option to create a scripts folder is designed to be used to represent the complete schema of the database so it can be used as a data source. The scripts themselves aren't really designed to be deployed to other environments.
Likewise, the deployments scripts that can include 'IF EXISTS' are designed to be a single script and can't be broken down per object, unless you go through and create a project for each object. If you right-click on an object in the results grid, you can create a single deployment script for that object, but you can't get it do that for all objects in one go.
If you don't mind me asking, why do you need the existence checks for each script?
Feel free to log the suggestion on our uservoice site if you need it added to the tool.
Can I ask why you want separate scripts for each object. How do you plan to use them?
David Atkinson
Product Manager
Red Gate
Product Manager
Redgate Software
We have install script shipped with our product. The install folder has script for each table and executed by controlled file listing all objects to install. In case an installation failed i want this to be re-runnable picking up from the objects it stopped. Let's say it installed all tables from A-C and failed on FK creation and exited. Next time I run install I want to skip all tables A-C and continue creating objects. I understand that i use script folder as not as intended.
David
Product Manager
Redgate Software