11,849
社区成员
发帖
与我相关
我的任务
分享
----try...catch用法
begin try
select 1/0
end try
begin catch
print'打印错误'
end catch
---raiserror的用法
begin try
raiserror('生成一个错误消息',11,1)
end try
begin catch
select error_message() as 错误消息,
error_severity() as严重级别,
error_state() as state;
end catch
begin try
--sql....
end try
begcatch
error_message()
end catch