--语法
begin try
--SQL
end try
begin catch
--sql (处理出错动作)
end catch
begin try
select 2/0
end try
begin catch
select error_number() as error_number ,
error_message() as error_message,
error_state() as error_state,
error_severity() as error_severity
print error_number()+ error_severity() +error_state()+error_procedure()+error_line()+error_message()
end catch
时间: 2024-11-05 21:13:37