Solved

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

Posted on 2011-09-16
5
274 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
ID: 36552993
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
ID: 36552998
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
ID: 36553069
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
ID: 36553077
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
ID: 36553585
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
In this article I will describe the Detach & Attach method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

839 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