?
Solved

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

Posted on 2011-09-16
5
Medium Priority
?
286 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 60

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 60

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 60

Accepted Solution

by:
Kevin Cross earned 800 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 200 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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

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.
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…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

770 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