Can someone tell me how to swap this absolute path with a relative one for my sqlcmd upgrade script?
-- how can I get rid of the following absolute path variable from my script?
:SETVAR ScriptDir "C:\absolutePath\"
:SETVAR DeployLog "upgradeDb.out.log"
:SETVAR ErrorLog "upgradeDb.err.log"
:Error $(ScriptDir)$(ErrorLog)
:OUT $(ScriptDir)$(DeployLog)
:ON ERROR EXIT
print ' run scripts a and b'
:r $(ScriptDir)"a.sql"
:r $(ScriptDir)"b.sql"
PRINT 'finished'
GO
:EXIT
print 'problem...'
GO
Originally posted (in the wrong place) here: https://softwareengineering.stackexchange.com/questions/318033/how-to-use-a-relative-path-in-sqlcmd-script