April 26, 2010 at 10:53 pm
Second error return 50000
(1 row(s) affected)
Msg 50000, Level 16, State 1, Line 2
oh no, error!
(1 row(s) affected)
(1 row(s) affected)
Msg 50000, Level 16, State 1, Line 6
oh no, another error!
(1 row(s) affected)
April 26, 2010 at 10:58 pm
Return 0 because there is a statement between (select 'xyz'), and this statement do not raise error
April 27, 2010 at 1:03 am
Lynn Pettis (4/26/2010)
What is interesting is that approximately a third of the respondents have gotten the question wrong.
I'm amongst that respondents because I haven't used @@error since 2006, and I've already forgotten about this function 🙂
April 27, 2010 at 5:05 am
Select 'xyz' will not return any error.
so @@error return 0
May 18, 2010 at 5:54 am
Thanx Dear for ur ans.
Thanks
SUrya
March 21, 2012 at 5:33 pm
@@error will have the right error code if selected immediately after raiserror command
raiserror('oh no, another error!', 16,1)
select @@error
Thanks
Igor Micev,My blog: www.igormicev.com
February 1, 2013 at 5:45 am
Previous question also same like this.... easy only.....
Manik
Go fast as possible
Manik
You cannot get to the top by sitting on your bottom.
November 16, 2015 at 4:30 am
Hi,
I executed this code in SQL Serve 2012 and I received the errors sequence:
(1 row(s) affected)
Msg 50000, Level 16, State 1, Line 2
oh no, error!
(1 row(s) affected)
(1 row(s) affected)
Msg 50000, Level 16, State 1, Line 6
oh no, another error!
(1 row(s) affected)
(1 row(s) affected)
I answered 50.000
Viewing 8 posts - 16 through 22 (of 22 total)
You must be logged in to reply to this topic. Login to reply