How can we help you today? How can we help you today?
Kendra_Little
Hello, To deploy a SQL Change Automation project, the process we recommend flows like this:  Run a successful build for the code you want to deploy. This outputs an artifact in the form of a NUGET package. Deployment is a two step process: A. Create a release artifact using the NUGET package from the build and setting the target database. This looks at what has been deployed so far to the target database and also can evaluate things like whether drift has occurred since your last deployment. B. Deploy the release artifact to the target database. If you are sure that all target databases will be the same and are not concerned about drift, it is possible to create a release artifact against one database, and then deploy it to as many target databases as needed.   All of the steps above can be done using PowerShell. (References here have good examples: New-DatabaseReleaseArtifact, Use-DatabaseReleaseArtifact) To dig into your question, the NUGET package from the build does essentially contain a copy of the migration files from the project. So this process is, essentially, moving the migration files for you. But it also adds significant functionality on top of that, like checking which migrations have already been run against the target, running the migrations in the same order as has been tested in the verify and build process, etc. Hope this helps, Kendra / comments
Hello,To deploy a SQL Change Automation project, the process we recommend flows like this:  Run a successful build for the code you want to deploy. This outputs an artifact in the form of a NUGET ...
0 votes
Hello, Apologies for the delay, just catching up on this thread this morning. I believe we have shifted the discussion of question #4 to this thread now. Cheers, Kendra / comments
Hello,Apologies for the delay, just catching up on this thread this morning. I believe we have shifted the discussion of question #4 to this thread now.Cheers,Kendra
0 votes
Hello, 1. SQL Server doesn't provide a simple way to do this type of refactoring. What you are doing is changing the structure of the data which is being stored for the business key column of a table, which is an essential part of the table structure. You will need to remove foreign key relationships / other constraints, remove primary keys, make the column change, and then recreate the PK, indexes, and constraints. There are some scripts from around the web which may help you loop through tables and save some time on sites like StackOverflow. Needs tend to vary depend on the database schema you're changing, so it's likely you will need to customize the scripts to meet your situation. You don't have to worry about the individual scripts being perfect, though -- you just need to get your development database into the state you'd like it to reach in the end. So if you make a mistake, you can correct it. 2. This is going to vary based on the size of your tables, the nature/quality of the data you have in the columns, and the downtime you have available for deployment. There's no single answer to this. For very large tables, some might even choose to create a new table, insert the data into it, and do a switcheroo for performance reasons. (Here's an example of a very fancy approach that some use if they can't have downtime.) 3. Yes. When you have a set of changes made in a database that you would like to commit to version control, at that point you can generate migration scripts and import the changes, review them, and commit them. The SQL Compare Engine will analyze the objects which have been changed that you've selected to import and compare this with the prior schema which you captured in version control. It will script out the most efficient way to to make the version in source control reach the desired state of your dev database. You can review that code and tweak it as required.  4. Customers typically use some combination of orchestration systems such as Jenkins, Azure DevOps, Octopus Deploy, etc to automate builds, tests, and deployments of database code for SQL Change Automation. The functionality is also available in PowerShell scripts if you wish to execute the PowerShell directly. Hope this helps, Kendra / comments
Hello,1. SQL Server doesn't provide a simple way to do this type of refactoring. What you are doing is changing the structure of the data which is being stored for the business key column of a tabl...
0 votes