0

I am new to Azure DevOps.

I have created a stored procedure and after merging the changes with the repository.

I ran the pipeline but that stored procedure is not reflected in the database.

Other functions and tables were deployed successfully, only stored procedures are not deployed.

Can anyone help me with this?

Thanks in advance!

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Explorer
  • 161
  • 1
  • 4
  • 16

1 Answers1

1

The most likely issue is your project file. When adding new objects to a database project, the scripts must also be configured in the project file with the Build Action set to Build.

  • Open the project in Visual Studio and ensure the stored procedure shows up in the Solution Explorer. If not, add it to the Stored Procedures folder with Add > Existing Item.
  • View the properties of the stored procedure and ensure the Build Action is set to Build.
  • Save and commit the changes to the project file. When adding a new object, you have to commit the new object and the changes to the project file or the new object will not be included in your build.

One other item to check would be the configuration of your Release in DevOps. Review the Additional SqlPackage.exe Arguments and ensure there is nothing there that would cause Stored Procedures to be skipped.

RobertT
  • 136
  • 4
  • Thanks for your Answer! In my case, it was the issue of permission. So, one of the team member ran this command `GRANT EXEC ON [dbo].[SP_NAME] TO PUBLIC` .and that SP was reflected in DB for me – Explorer Nov 25 '21 at 10:51