Jason Gerrish
SSC Rookie
Points: 30
More actions
September 28, 2004 at 10:05 am
#86670
Does Set NoCount On/Off reset @@Error?
I was trying to figure out a way to test this in Query analyzer, but whenever I force an error, I never get to move onto the Print Cast (@@Error as varchar(10))
Thanks,
Jason
Aaron Templeton
SSCarpal Tunnel
Points: 4655
September 28, 2004 at 11:09 am
#524675
Yes it does. Try the following with and without the set nocount on line commented out.
declare @ErrorCd int
raiserror ( 'test', 12, 12 )
set nocount on
set @ErrorCd = @@Error
print @ErrorCd
September 28, 2004 at 12:05 pm
#524681
Perfect...not sure why I didn't think of that...duh! Thank you that is exactly what I needed to prove what I believed to be true.
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply