简体   繁体   中英

What does Level and State refer to in Microsoft SQL Server Query Analyzer

I use Query Analyzer all the time and am often greeted by errors where I am told a level and a state but never a line number. Presumably level and state are useful pieces of information, though I have never seen these defined.

State: microsoft

State 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.

Level (of severity): Microsoft again

Also see: RaisError()

In real life practice (+15 years), if I don't understand the error I just paste it in a search. and look for similar errors that give a better explanation of the problem or a place to start looking for a solution.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM