Solved

6232B_12 Handling Errors in T-SQL Code: What's in an Error?

Posted on 2011-09-16
5
271 Views
Last Modified: 2012-05-12
Hi experts, i am reading about  What's in an Error? but i do not understand

State: Value used to determine the location in code at which an error occurred
can you give me an example or explain me more details?
0
Comment
Question by:enrique_aeo
  • 3
5 Comments
 
LVL 59

Expert Comment

by:Kevin Cross
Comment Utility
Hi. Think about how you would "locate" code visually. You would use the fact that code is essentially on individual lines, right? http://msdn.microsoft.com/en-us/library/ms178600.aspx ;)
0
 

Author Comment

by:enrique_aeo
Comment Utility
this is the defintion
"Some error messages can be raised at multiple points in the code for the Database Engine. For example, an 1105 error can be raised for several different conditions. Each specific condition that raises an error assigns a unique state code.

When you are viewing databases that contain information about known issues, such as the Microsoft Knowledge Base, you can use the state number to determine whether the recorded issue is the same as the error you have encountered. For example, if a Knowledge Base Article describes an 1105 error that has a state of 2 and the 1105 error message you received had a state of 3, the error probably has a different cause than the one reported in the article.

A Microsoft support engineer can also use the state code from an error to find the location in the source code where that error code is being raised. This information might provide additional ideas on how to diagnose the problem."
http://msdn.microsoft.com/en-us/library/ms165761.aspx

BUT I DO NOT UNDERSTAND
0
 
LVL 59

Expert Comment

by:Kevin Cross
Comment Utility
I am sorry. I read that as "state the value used to determine the location..." i.e., error line or line number. :) I will try again now that I see that is about State within error message. When I locate the reference of all 127 states, I will post. At least ERROR_STATE can be 1 - 127 identifying at what stage the error occurred.
0
 
LVL 59

Accepted Solution

by:
Kevin Cross earned 200 total points
Comment Utility
And, I probably won't find a list *smile* -- state tells the source in SQL Server code that error generated from. As the description suggests, this information is helpful to Microsoft Engineers. You will probably see a number of errors are 1 because they only can get generated from one place. If however, there are multiple places or ways an error can be generated, the state allows the Engineers to pinpoint the exact source.
0
 
LVL 8

Assisted Solution

by:Ghunaima
Ghunaima earned 50 total points
Comment Utility
http://msdn.microsoft.com/en-us/library/ms180031.aspx

Studying this may help you.  also read about other ERROR-... () functions which are present in Refrence section of the page you specified.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now