Committing a sproc change with command line

lkeithlkeith Posts: 8
I have made a change to an sproc in a db not linked to source control (but I could if necessary).

I would like to commit the sproc change to source control using a command line interface.

Is this possible and if so, what can I do?
lkeith

Comments

  • Yes, you can use the command line to do this.

    more info here:
    http://www.red-gate.com/supportcenter/c ... _in_the_cl

    use /db1 and /server1 to specify the source
    use /scripts2 to specify the target
    use /sync to sync to the scripts

    And use your source control command line tool to commit to your repository. You'll have to consult the source control tool's documentation to achieve this.

    Why is it that you wish to do this?

    David Atkinson
    Red Gate
    David Atkinson
    Product Manager
    Redgate Software
  • I want to do this because I am making a change to an SP from a custom utility outside the usual source control and want to commit it to source control so everyone will get the changes.
    lkeith
  • Please give it a go and let us know how you get on. There's no reason why it shouldn't work, although it isn't something that we're asked very often!
    David Atkinson
    Product Manager
    Redgate Software
  • Thanks, David! Everything worked great. Now instead of modifying the sproc file in the repository and comitting to source control, I changed the SP in the DB then used SQLCompare to move the changes to the scripts repository then simply comitting to source control! Much more straigtforward.

    SQLCompare adds some SQL directives at beginning & end of all sproc scripts and all scripts are CREATE, not ALTER. I had to manually add this to each script I put in the repository. Now I don't have to do that since SQLCompare will now.

    Thanks again!
    lkeith
Sign In or Register to comment.