3

I need to automate SQL Server DB deployment using Azure DevOps. I don't want to give any alter statement. I will have a folder structure with tables, stored procedures, views & functions in repository. Every folder will contain only create scripts. Is there anyway to create DacPac file with that folder structure or any other way, other than DacPac deployment using that folder structure?

Note: I don't want to create DB project using Visual Studio. And I don't want to create a DacPac file directly from SQL Server Management Studio and checkin the same to source control. And I am not in a situation to pay for license.

4
  • A dacpac is the script files, or rather, the definitions of all objects as script. I don't want to create DB project using Visual Studio why? And I am not in a situation to pay for license. what license? There are no licenses involved. A dacpac is the output of a Database Project. Both SSDT and SSMS are free standalone downloads. You can also use Azure Data Studio if you want to work on Linux or Mac. Neither of these requires any license Commented Feb 19, 2021 at 10:56
  • What is your actual problem? Why such arbitrary restrictions, and why do you describe a Database project but say you don't want to use one? Commented Feb 19, 2021 at 11:06
  • Are you trying to package dynamically created files? You can still use a sqlproj for this that includes files using a wildcard. You can build the package with dotnet build Commented Feb 19, 2021 at 11:17
  • Hi friend, how about the issue? Does the answer below resolved your question? Commented Feb 25, 2021 at 8:37

3 Answers 3

1

You can try to use SQL Database Projects extension in Azure Data Sudio. It supports VS SQL Database Project and it supports builds from the command line: Build a database project from command line

Sign up to request clarification or add additional context in comments.

Comments

0

What you describe is the database project. A dacpac is the build output of a Database project. There are no licenses involved. All the tools that produce dacpac files are free:

Comments

0

Not exactly about sql server or dacpac, but more generic solution applicable to this use case.

Please take a look at liquibase and flyway projects. Both can help to keep track of what’s already deployed to database and deploy any new items automatically as part of CICD pipeline. Flyway could be better solution to your question, mostly you need to add some prefix to existing file names defining order of deployment, flyway can manage rest of the tasks for you. Liquibase has its own advantages, but adopting it at this stage needs some changes across all scripts.

Both projects have info on how to include this step in your CICD pipeline.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.