How can you determine the version of a stored procedure using command line?
pporter
Posts: 5 Bronze 1
We are using Red Gate version control on our system with TFS as the repository. Is there a way to programatically (or use of command line) determine the version of a stored procedure in both source control, and on a target server?
Tagged:
Best Answer
-
Diogo Posts: 67 Silver 5Hi @pporter
I think you can use the SQL Compare command line then. There is some documentation on this page http://https//documentation.red-gate.com/sc13/using-the-command-line
I think you may want something like
sqlcompare.exe /scr1:YourScriptsFolder /s2:YourDatabaseServer /db2:YourDatabaseName /u2:YourUsernameToConnectToTheDatabase /p2:YourPasswordToConnectToTheDatabase /Include:storedprocedure:\[YourStoredProcedureName\] /verbose
Answers
Can you give us a bit more detail about what you mean by "version of a stored procedure". Would you be interested in knowing which revision/commit is on the target server? Or are you just interested in checking the differences between what you have in source control and the target server?
Thanks,
Diogo
I would be interested in checking the differences between what we have in source control and the target server.
Thanks in advance
/scr1 is your local checkout of the repository.
sqlcompare.exe /scr1:http://al-tfs:8080/tfs/afg /s2:GDC-DEV-1\SQLEXPRESS /db2:AFGWMS /u2:username /p2:password /Include:storedprocedure:Abattoir.HouseTagReserve_Select /verbose