Is RedGate supports for taking DB backup in pipeline? If possible, how to take it without data and taking only specific objects like Store Procedures and Views?
To capture the schema for specific objects without data, you can use the SQL Compare command line.
Here's an example command. This example compares a database to the "schema-model" folder in the release artifact for a SQL Change Automation project. In an Azure DevOps pipeline, you can set up a step after creating a release artifact (but before deployment) and run this step, and it will write out a rollback script for the stored procedures, views, and functions which the release is modifying:
In an Azure DevOps pipeline, you will probably need to use the ReleaseName variable for the path to the release artifact
If you are using a SQL Source Control project, you can do a similar pattern, but just point it to the folder holding your state in the release artifact
If you want to script out ALL of these types of objects, not just those modified in a release, you can compare the database to an empty folder
Coincidentally, I'm working on some improved documentation and examples for this right now
Hope this helps and let me know if you have questions,
Answers
To capture the schema for specific objects without data, you can use the SQL Compare command line.
Here's an example command. This example compares a database to the "schema-model" folder in the release artifact for a SQL Change Automation project. In an Azure DevOps pipeline, you can set up a step after creating a release artifact (but before deployment) and run this step, and it will write out a rollback script for the stored procedures, views, and functions which the release is modifying:
Some notes:
Coincidentally, I'm working on some improved documentation and examples for this right now
Hope this helps and let me know if you have questions,
Kendra
Could you please provide if any detailed documentation with examples for taking backup in azure pipeline
Regards.
Manisankar