If the try block looks like BEGIN TRY Print 'Hi'; Select 15/0; print 'Hello'; Select 10/0; END TRY the error line display is 3 (Select 15/0;) i need to print the both the error 10/0 also what to do?
@mssqlexpert7 ай бұрын
this is Runtime error, first you have to resolve first error then sql engine knows second 10/0- divide by zero error. then it will print. BEGIN TRY Print 'Hi' Select 15/0 print 'Hello' Select 10/0 END TRY Begin catch Select ERROR_MESSAGE(),ERROR_NUMBER() End catch not tried yet such scenario, i have to check it. Thanks.