Comments
5 comments
-
You need to have SQL Source Control installed on the same system where you are running the command.
The example below should worksqlcompare.exe /s1:LiveSQLServer /db1:LocalDB /SourceControl2 /Revision2:HEAD /ScriptsFolderXML:xml.xml
You can get the text needed to create xml.xml from SQL Source Control (more specifically on the Under the Hood section in the Setup tab for the SQL Source Control database)
https://documentation.red-gate.com/sc/using-the-command-line/switches-used-in-the-command-line#Switchesusedinthecommandline-/ScriptsFolderXML:%3Cfilepath%3E
-
Alternatively, you could also checkout the version you want to compare using tf.exe (or corresponding tool for other Version Control Systems) and do a database to Scripts Folder comparison, in this case you would need the /Scripts2 switch only (instead of /SourceControl2, /Revision2 and /ScriptsFolderXML).
-
Thanks for the response.
I see the option in the UI to connect to a remote tfs, but it just is not available for command line...?
I am trying to automate a report to show the differences between prod/dev and prod/tfs. The trick is that we have single-tenant databases and lots of clients. I have the first part working through tsql creating the bat file with the appropriate commands, run the bat to create output, which then are read through a second sproc to give me a meaningful output.
If I could do the same thing with tfs/prod...then I'd be set.
I think downloading the latest version will work, I will try that one out this week.
Thanks again!
-
More questions...
I got the /Scripts1 switch working (thanks!), but I can't figure out how to identify which directory is for which database. The names are obfuscated and I can't find a mapping anywhere. Is that available for me to use? -
I found it. LinkedDatabases.xml
Add comment
Please sign in to leave a comment.
Version:13.8.0.12703 pro
-ScriptFolderDescription-$/companyname/Databases/dbname on https://companyname.visualstudio.com/
how do I translate that to command line using the switches available?