Sync Scripts to Database
I'd like to be able to sync my database scripts which are stored directly in TFS (source control) as my 'source' db and then specify an actual database server as my 'target' database just like you do in the command line options for redgate sql compare.
-
Jeff Taylor commented
I was using SQL CI, the problem is you have to use a 'test' or 'intermediate database. As to my knowledge this is not completed. If so, please provide me with instructions/information on this.
-
Peter Gerrard commented
Hi Jeff, you can do this with the new PowerShell cmdlets available in the DLM Automation Suite.
To do the update you would run the PowerShell:
$database = New-DlmDatabaseConnection -ServerInstance "<server>" -Database "<database>"
$tfsScriptsPath = "<path to scripts folder>"
Sync-DlmDatabaseSchema -Source $tfsScriptsPath -Database $databaseIf you would rather use a commandline call you can invoke powershell.exe with the above script like this:
powershell -Command {<script form above>}For reference on the Sync cmdlet please check https://documentation.red-gate.com/display/SR1/Sync-DlmDatabaseSchema
-
Jeff - does that mean you're orchestrating the automation without the help of a CI/build tool?