CLI Operation

ChrisMeekChrisMeek Posts: 2
edited February 10, 2017 11:34AM in SQL Source Control
Hey All,

I'm working on some automated setup for new team members; I'm creating a simple primer script that does all the usual gubbins; install IIS/git/SQL/VS, clone the repo, create websites/app-pools, build the solution etc, pretty standard stuff. What I'm struggling to figure out at the moment is how to set up the sql source control linking from the command line and apply incoming changes when the developer pulls from git. Having looked around the forum it does seem like these things are only currently available through the SSMS gui, so my question is whether CLI operation is on the roadmap anywhere?

Regards,
Chris

Comments

  • Hi Chris,

    Thank you for your post.

    We are not planning to add CLI functionality to SQL Source Control: SQL Source Control is meant to be used on the development environment and we believe that the best way to work with the tool is to commit from SSMS straight after changing the DB.

    SQL Compare Pro, which you can use to deploy to or from Source Control has a Command Line Tool: http://documentation.red-gate.com/displ ... mmand+line
    Sergio
    Product Support Engineer
    Redgate Software Ltd
    Please see our Help Center for detailed guides on how to use our tools
  • jschwarzjschwarz Posts: 15 Bronze 2
    Sergio R, I have SQL Compare Pro, and I am trying to accomplish the same thing as the op. Can you direct me to instructions on how to get an initial link and commit accomplished from the cli?
    Like many on the forum, I have had a problem getting this to work from the cli even with the PRO version of the software.

    Here is an example of my attempt to use the cli for this purpose, and the resulting error, I've seen many others reference this same error on the forum but never seen a definitive answer. When the cli tries to connect to SVN it gets denied due to authentication. In my case I have verified that the url in question is definitely avai Can you please take a look and direct me to a resource that can help me accomplish this?

    U:\>E:\RedGate\SQLCompare11\sqlcompare.exe /Server1:TSTDBATEST /Database1:DbaTesting2 /sourcecontrol2 /Revision2:HEAD /ScriptsFolderXML:F:\MSSQL\SQLDeployment\SQLSourceXML\Dbatesting2SourceXMLLink.txt /ignoreparsererrors /v /sync /force
    SQL Compare: activated, edition: professional, serial number: 512-010-190515-9169
    SQL Compare Command Line V11.4.10.109
    ======================================================================================================================================================================================================
    Copyright Copyright c 1999 - 2016 Red Gate Software Ltd

    Argument /server1 has value 'TSTDBATEST'
    Argument /database1 has value 'DbaTesting2'
    Argument /sourcecontrol2 has value 'True'
    Argument /revision2 has value 'HEAD'
    Argument /scriptsfolderxml has value 'F:\MSSQL\SQLDeployment\SQLSourceXML\Dbatesting2SourceXMLLink.txt'
    Argument /ignoreParserErrors has value 'True'
    Argument /verbose has value 'True'
    Argument /synchronize has value 'True'
    Argument /force has value 'True'

    Comparing database TSTDBATEST.DbaTesting2 with database ....
    Registering data sources
    Error: Comparison of 'TSTDBATEST.DbaTesting2' and '.' failed: URL 'https://svn.artisanpartners.com/svn/Databases/Dbatesting2' doesn't exist
  • jschwarzjschwarz Posts: 15 Bronze 2
    edited September 26, 2017 3:18PM

    ChrisMeek, you may find this link to have the information that you need...
    https://alessandroalpi.blog/2016/06/28/automatically-link-databases-to-red-gate-sql-source-control/
Sign In or Register to comment.