Joe Webb

Musing and observations about SQL Server, other technogies, and sometimes just life in general
posts - 85, comments - 857, trackbacks - 0

My Links

News

This blog has moved!

Click here for the new location.

Follow me on Twitter
Add to Technorati Favorites

Search this Blog
 




Archives

Post Categories

About me

SQL Server error messages

 

If you've worked with Microsoft SQL Server in a production environment for any length of time, you've undoubtedly been exposed to a number of different error messages. For example, many of us are probably familiar, too familiar perhaps, with error 1205 - the dreaded "you've been chosen as the victim of a deadlock" message.

Or maybe you are more of a developer than a DBA. So you may be more familiar with error messages like 2714 - "there is already an object named this in the database."

There may be many messages that we feel that we know by heart. However there are many more that we do not.

Have you ever been given an error number without the associated message? If someone came to you and said "The application gave me error 8115. What does that mean?" would you know where to look? A quick search on Google or Windows Live Search may produce the information you seek.

However, SQL Server has this information built into its metadata. The sysmessages system table in SQL Server 2000 and the sys.messages catalog view in SQL Server 2005 contain a list of errors that SQL Server may produce and their associated messages.

So, to quickly see the message test associated with error number 8115, you can run the following query in SQL Server 2005. I have filtered the output to only show results in English; other languages may be available.

SELECT         
*
FROM
sys.messages
WHERE
message_id = 8115 AND
language_id = 1033

The equivalent SQL Server 2000 equivalent is as follows.

SELECT         
*
FROM
master.dbo.sysmessages
WHERE

error = 8115 AND
msglangid = 1033

 

Once again, I have limited the output to English.

For more information, refer to Books Online and look up sys.messages for SQL Server 2005 or sysmessages for SQL Server 2000.

Cheers!

Joe

kick it on DotNetKicks.com

Print | posted on Friday, December 07, 2007 4:52 PM | Filed Under [ T-SQL SQL Server ]

Feedback

Gravatar

# re: SQL Server error messages

It's really helpful :)
12/13/2007 8:15 AM | Shambhu A. Vishwakarma
Gravatar

# re: SQL Server error messages

Really explained with a good and simple example.
Thank you very much
11/12/2008 11:06 PM | Praveenkumar Jeykumar
Gravatar

# re: SQL Server error messages

Thanks Joe! Good information!
1/7/2009 11:05 AM | Mike Groh
Gravatar

#  re:SQL Server error messages

Its HelpFul, Nice Example
7/28/2009 7:37 AM | Praveen Agrawal
Gravatar

# re: SQL Server error messages

Thanx a lot! it wa really helpful
8/8/2010 1:34 AM | Hosein
Gravatar

# re: SQL Server error messages

So, to quickly see the message test associated with error number 8115, you can run the following query in SQL Server 2005. I have filtered the output to only show results in English; other languages may be available.

snow boots | columbia jackets | mac makeup | the north face outlet
10/20/2010 2:34 AM | snow boots for women
Comments have been closed on this topic.

Powered by:
Powered By Subtext Powered By ASP.NET