{"id":4315,"date":"2012-08-24T12:08:31","date_gmt":"2012-08-24T12:08:31","guid":{"rendered":"https:\/\/test.simple-talk.com\/uncategorized\/powershell-sql-compare\/"},"modified":"2016-07-28T10:51:44","modified_gmt":"2016-07-28T10:51:44","slug":"powershell-sql-compare","status":"publish","type":"post","link":"https:\/\/www.red-gate.com\/simple-talk\/other\/powershell-sql-compare\/","title":{"rendered":"PowerShell &amp; SQL Compare"},"content":{"rendered":"<p>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.<\/p>\n<p>set-Location &#8220;c:\\Program Files (x86)\\Red Gate\\SQL Compare 10\\&#8221;;<\/p>\n<p>.\/sqlcompare \/s2:DOJO \/db2:MovieManagement_Sandbox \/sourcecontrol1 \/vu1:grant \/vp1:12345 \/r1:HEAD \/sfx:scripts.xml \/sync \/mfx:migrations.xml \/verbose;<\/p>\n<p>I would not recommend using the \/verbose output for real automation, but I&#8217;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&#8217;ve hard coded.<\/p>\n<p>That&#8217;s it. Works great. Just wanted to share it out there. I have others that I&#8217;ll track down and put up here.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 &#8220;c:\\Program&#8230;&hellip;<\/p>\n","protected":false},"author":221792,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[2],"tags":[],"coauthors":[],"class_list":["post-4315","post","type-post","status-publish","format-standard","hentry","category-other"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/4315","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/users\/221792"}],"replies":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/comments?post=4315"}],"version-history":[{"count":4,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/4315\/revisions"}],"predecessor-version":[{"id":42217,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/4315\/revisions\/42217"}],"wp:attachment":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/media?parent=4315"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/categories?post=4315"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/tags?post=4315"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/coauthors?post=4315"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}