SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


what does the second @@error return?


what does the second @@error return?

Author
Message
Igor Micev
Igor Micev
SSChampion
SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)

Group: General Forum Members
Points: 10006 Visits: 5155
@@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
manik_anu
manik_anu
SSChasing Mays
SSChasing Mays (627 reputation)SSChasing Mays (627 reputation)SSChasing Mays (627 reputation)SSChasing Mays (627 reputation)SSChasing Mays (627 reputation)SSChasing Mays (627 reputation)SSChasing Mays (627 reputation)SSChasing Mays (627 reputation)

Group: General Forum Members
Points: 627 Visits: 313
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.
Junior Galvão - MVP
Junior Galvão - MVP
Hall of Fame
Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)

Group: General Forum Members
Points: 3667 Visits: 216
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
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search