If any files are found it will delete them. This process will check to see if there are any files that already exist in the directory found in the $outfile_for_script variable.The $outfile_for_script variable is where the script will be written too.I always like seeing stuff printed to the screen. By changing the Powershell Preference Variable we can turn off the debug output in one place. I have created several Write-Debug messages to help understand what is going on when the script is being executed.The following code example includes comments to help you understand the process. Solution: Use SQL Compare Command-Line and Powershell to automate this process.įor this process to work, you must have a DB, locally on your box using Redgate SQL Source Control synced to TFS, GIT or some Source Control platform. There has got to be a way to automate this process and schedule an update\upgrade script creation. Doing some basic math, you could extrapolate that this process costs the company over 10K a year.
It can take upwards of 4 hours a week to generate these scripts. Once SQL Compare finds the changes and creates the script, a very time-consuming process begins of copy and pasting other changes from other static scripts in TFS into the script created by SQL Compare. The current process in place now relies on SQL Compare to compare a previous version of the DB vs the current source control. We fall under the “State or Model Based Approach” meaning “DB Developers only concern themselves with defining the desired end state, not how the transition occurs”, per Redgate documentation regarding DevOps approaches.
#Redgate sql toolbelt comparing database update
Problem: The QA team as well as Dev team will update their Development Database with the current code via an update\upgrade script.