Is there a try/finally construct in sqlcmd with -b option, guaranteed to execute the finally block?
Database
5
Posts
3
Posters
0
Views
1
Watching
-
Can I use something like try/finally construction for guaranteed run script with -b option in sqlcmd? The task is: turn on single user mode run some scripts that may be errors guaranteed turn off single user mode
-
Yes, even Sql has the famous
try..catch
[^] block. Your "finally" would be included at the end of the "try" part.Bastard Programmer from Hell :suss: if you can't read my code, try converting it here[^]
-
Eddy Vluggen wrote:
Your "finally" would be included at the end of the "try" part.
Whaaaa....? No. Shirley that wont work like a finally block.
-