Skip to content

Instantly share code, notes, and snippets.

@kulmam92
Created September 23, 2013 13:35
Show Gist options
  • Save kulmam92/6670495 to your computer and use it in GitHub Desktop.
Save kulmam92/6670495 to your computer and use it in GitHub Desktop.
Check in DB schema to SVN using SQLCompare.
SVN add --username MyUser --password MyUserP@ss --force * --auto-props --parents --depth infinity
SVN commit --username MyUser --password MyUserP@ss -m "Daily Checkin"
@Echo OFF
set VarServer1=%1
set VarDB1=%2
set VarUserName1=%3
set VarPassword1=%4
set VarScriptFolder=%5
rem ==================================
rem If /Include:Identical is not set, and the data sources are identical, SQL Compare returns the error code 63
rem ===================================
if not exist %VarScriptFolder%\RedGateDatabaseInfo.xml (
sqlcompare /server1:%VarServer1% /db1:%VarDB1% /UserName1:%VarUserName1% /Password1:%VarPassword1% /Makescripts:%VarScriptFolder%
) else (
sqlcompare /server1:%VarServer1% /db1:%VarDB1% /UserName1:%VarUserName1% /Password1:%VarPassword1% /Scripts2:%VarScriptFolder% /Synchronize /Force /Include:Identical
)
echo %ERRORLEVEL%
EXIT %ERRORLEVEL%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment