PowerShell & SQL Compare

Posted by Grant Fritchey on Simple Talk See other posts from Simple Talk or by Grant Fritchey
Published on Fri, 24 Aug 2012 12:08:31 +0000 Indexed on 2012/08/27 21:51 UTC
Read the original article Hit count: 317

Just a quick blog post to share a couple of scripts for using PowerShell to call SQL Compare. This is an example from my session at SQL in the City on setting up a sandbox development process. This just runs a compare between a set of scripts and a database and deploys it.

set-Location “c:\Program Files (x86)\Red Gate\SQL Compare 10\”;

./sqlcompare /s2:DOJO /db2:MovieManagement_Sandbox /sourcecontrol1 /vu1:grant /vp1:12345 /r1:HEAD /sfx:scripts.xml /sync /mfx:migrations.xml /verbose;

I would not recommend using the /verbose output for real automation, but I’m showing off how the tool works. This particular script does a compare straight from source control to a database on my server. You can use variables where I’ve hard coded.

That’s it. Works great. Just wanted to share it out there. I have others that I’ll track down and put up here.

 

© Simple Talk or respective owner

Related posts about Uncategorized

Related posts about powershell