| Author |
Message |
lkeith
Joined: 21 Aug 2012 Posts: 6
|
Posted: Tue Aug 21, 2012 6:01 pm Post subject: Committing a sproc change with command line |
|
|
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 |
|
| Back to top |
|
 |
David Atkinson
Joined: 05 Dec 2005 Posts: 1080
|
Posted: Tue Aug 21, 2012 9:25 pm Post subject: |
|
|
Yes, you can use the command line to do this.
more info here:
http://www.red-gate.com/supportcenter/content/SQL_Compare/help/10.0/sc_cl_Switches_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 |
|
| Back to top |
|
 |
lkeith
Joined: 21 Aug 2012 Posts: 6
|
Posted: Tue Aug 21, 2012 9:28 pm Post subject: |
|
|
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 |
|
| Back to top |
|
 |
David Atkinson
Joined: 05 Dec 2005 Posts: 1080
|
Posted: Tue Aug 21, 2012 9:30 pm Post subject: |
|
|
| 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! |
|
| Back to top |
|
 |
lkeith
Joined: 21 Aug 2012 Posts: 6
|
Posted: Wed Aug 22, 2012 3:47 pm Post subject: |
|
|
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 |
|
| Back to top |
|
 |
|
|
All times are GMT + 1 Hour
|
| Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group