if not object_id('tempdb..#p') is null drop proc #pgocreate proc #p as raiserror 20009 '错误,原因是ABC' return -1 goSet XACT_ABORT on exec #p if @@error <> 0 raiserror 20010 '执行#p错误,错误信息是:' --这里,怎样得到"错误,原因是ABC"感觉兄的不行。
我看了一个帮助,帮助上的raiserror有通过全局变量来传的
if not object_id('tempdb..#p') is null drop proc #pgocreate proc #p as raiserror (50009, 16, 2) return -1 goSet XACT_ABORT on exec sp_dropmessage 50009 exec sp_addmessage @msgnum = 50009, @severity = 16, @msgtext = N'错误,原因是ABC' exec #p if @@error <> 0 select 1 raiserror (50009, 16, 2)
raiserror 20009 '错误,原因是ABC'
return -1
goSet XACT_ABORT on
exec #p
if @@error <> 0
raiserror 20010 '执行#p错误,错误信息是:' --这里,怎样得到"错误,原因是ABC"感觉兄的不行。
raiserror (50009, 16, 2)
return -1
goSet XACT_ABORT on
exec sp_dropmessage 50009
exec sp_addmessage @msgnum = 50009, @severity = 16, @msgtext = N'错误,原因是ABC'
exec #p
if @@error <> 0
select 1
raiserror (50009, 16, 2)
替换所有raiserror
要改原有过程
但只是全部替换
应该很方便
拿UE一次性替换
不用五分钟