Answered by:
Publish only changes from stored procedures and views from one database to another in Azure Repos

Question
-
I have created a database project in visual studio that includes schemas, tables, stored procedures and tables. I've added them to source control in Azure Repos. I want to publish only the stored procedures and views to another database(they have the same table schemas).
When the project builds in azure pipeline it would create the build for all the database objects and the release pipeline would publish these changes to the database. Is there any way to exclude the tables and only build and publish stored procedures and views?
Answers
-
When creating the build in Azure pipeline, can we specify to use SQLPackage.EXE ?
No modification required in Build. It will build all SQL objects - tables, views, SP etc and create a dacpac including all of them.
In the release task, you can mention ExcludeObjectTypes=Tables so that it won't deploy them.
If the response helped, do "Mark as answer" or upvote it
- Vaibhav- Proposed as answer by NavtejSaini-MSFTMicrosoft employee, Moderator Monday, November 18, 2019 2:02 PM
- Marked as answer by Sindu_9090 Wednesday, November 20, 2019 5:11 AM
All replies
-
Can you use SQLPackage.EXE?
/p:ExcludeObjectTypes=Tables;ApplicationRoles;Assemblies;Tables;AsymmetricKeys;^
BrokerPriorities;Certificates;Contracts;DatabaseRoles;DatabaseTriggers;^Best Regards,Uri Dimant SQL Server MVP, http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting: Large scale of database and data cleansing
Remote DBA Services: Improves MS SQL Database Performance
SQL Server Integration Services: Business Intelligence
-
-
https://docs.microsoft.com/en-us/azure/devops/pipelines/targets/azure-sqldb?view=azure-devops&tabs=yaml
Best Regards,Uri Dimant SQL Server MVP, http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting: Large scale of database and data cleansing
Remote DBA Services: Improves MS SQL Database Performance
SQL Server Integration Services: Business Intelligence
- Proposed as answer by NavtejSaini-MSFTMicrosoft employee, Moderator Monday, November 18, 2019 2:02 PM
-
The Pipelines menu contains sub-menus for builds, releases, library, task groups and deployment groups. We will be focusing on the first two sub-menus.
A build pipeline defines the steps to take during build and the triggers that initiate a build. A release pipeline can be used to automate database deployments to one or more environments. Approvers can be added to guarantee that releases occur at the right time in the project schedule. Of course, logging of both types of pipelines allows the support staff to easily debug any issues that arise. Last but not least, releases can be initiated manually or automatically off a build.
- Proposed as answer by NavtejSaini-MSFTMicrosoft employee, Moderator Monday, November 18, 2019 2:02 PM
-
When creating the build in Azure pipeline, can we specify to use SQLPackage.EXE ?
No modification required in Build. It will build all SQL objects - tables, views, SP etc and create a dacpac including all of them.
In the release task, you can mention ExcludeObjectTypes=Tables so that it won't deploy them.
If the response helped, do "Mark as answer" or upvote it
- Vaibhav- Proposed as answer by NavtejSaini-MSFTMicrosoft employee, Moderator Monday, November 18, 2019 2:02 PM
- Marked as answer by Sindu_9090 Wednesday, November 20, 2019 5:11 AM
-