begin try
exec dbo.spBlah
end try
GO
create proc dbo.spBlah
as
--
is there any way to know?
--(end)
GO
one reason why it matters is so you can write this:
if (@flag = 1) begin
raiserror('hello', 16, 1)
end
instead of this:
if (@flag = 1) begin
raiserror('hello', 16, 1)
return
end
without having to use
set xact_abort on
and on a similar topic do I have to do this:
begin catch
if (@@trancount > 0) rollback tran
declare @error nvarchar(2048)
select @error = error_message()
raiserror(@error, 16, 1)
end catch
because that gets old quite quickly
raiserror(error_message(), 16, 1)
doesn't work