I have a release pipeline which applies database changes with 'SqlCmd.exe'. I am trying to execute a stored procedure using this command-line utility:
/opt/mssql-tools/bin/sqlcmd -S tcp:$(Server) -d $(Database) -U $(UserName) -P '$(Password)' -b -i "$(ScriptFile)"
Once something goes wrong in the script file, I want to SQLCMD.EXE automatically rollback all the changes.
I should mention that there is no TRANSACTIONS management inside the script file.
Please help me to learn how to resolve this.