Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I'm struggling a bit how I should do proper error handling in SSDT, particularly in a pre deployment script. I noticed that for what ever reasons the SQLCMD syntax

 :on error exit 

is not working. However how should I stop the deployment if the pre deployment script creates an error ? Also GOTO for example to the end of a post deployment script seems not working. Is it really possible that SSDT doesn't support error handling ?

Most obscure, when I set the publish setting "Script state checks" the generated script itself is using :on error exit, however if I use it in my own pre deployment script I get an error message that it's not allowed (eventhough the code is marked as SQLCMD syntax).

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.