﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Article Discussions / Article Discussions by Author / Discuss content posted by Mudassar Ahmed Khan  / Get Error Description in SQL Server 2000 / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Sat, 18 May 2013 12:43:51 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Get Error Description in SQL Server 2000</title><link>http://www.sqlservercentral.com/Forums/Topic635145-1456-1.aspx</link><description>I found both the article AND the subsequent discussion here very useful.  Thank you to all!</description><pubDate>Sun, 18 Jan 2009 16:45:23 GMT</pubDate><dc:creator>mishaluba</dc:creator></item><item><title>RE: Get Error Description in SQL Server 2000</title><link>http://www.sqlservercentral.com/Forums/Topic635145-1456-1.aspx</link><description>The sysmessage is there but since there are multiple insert stmts and multiple update stmts just looking at the placeholder is very difficult. Since in my case the support IT team required the exact error description so that they can sort the issue as soon as possible. since sys messages give only the template message. for eg Inserting Null value into a column which does not allow it. In our case each table has around 15 - 25 columns. So it would be very difficult to find out looking at the sysmessage that which table the issue has occurred and which value was Null. </description><pubDate>Thu, 15 Jan 2009 21:35:51 GMT</pubDate><dc:creator>Mudassar Ahmed Khan</dc:creator></item><item><title>RE: Get Error Description in SQL Server 2000</title><link>http://www.sqlservercentral.com/Forums/Topic635145-1456-1.aspx</link><description>Is it me or are you guys missing a trick here?There is a system table named sysmessages where all error descriptions are stored (both system errors and user errors),  with reference to the place holders you should know for the most part which table caused the error as you should really be checking for errors at every stage of a transaction.  With regards to the column this is where my process falls short, you are not able able to capture it real time you would have to re-run the process to find the column that isn't happy.Once I'm in the office tomorrow I will post the full code I use for all error captures for all my databases.  This code allows you to trap the error, record the error message and the details of the process that caused the error and then issue an alert email to the DBA's or whoever you want to send the message to.The error capture process will store the error details and process details in the database you are working with if for any reason it cannot record the error in the database it reverts to storing the data in the server log.  I have to say I'm not a big fan of storing the error in the log as it is more difficult to extract in an automated manor than if it is stored in table where the error occurred or even in a central error capture database.</description><pubDate>Thu, 15 Jan 2009 13:07:05 GMT</pubDate><dc:creator>Mark Taylor-212571</dc:creator></item><item><title>RE: Get Error Description in SQL Server 2000</title><link>http://www.sqlservercentral.com/Forums/Topic635145-1456-1.aspx</link><description>I had a requirement to get the Exact Error Messages generated by SQL Server 2000. If I was not able to achieve that then we would have switched to Windows Service.</description><pubDate>Wed, 14 Jan 2009 11:43:04 GMT</pubDate><dc:creator>Mudassar Ahmed Khan</dc:creator></item><item><title>RE: Get Error Description in SQL Server 2000</title><link>http://www.sqlservercentral.com/Forums/Topic635145-1456-1.aspx</link><description>Some error messages are template and need to raiseerror first, check for the error number and get error description, at that point, you will get the target objects (table name, column etc ..) replaced.  This applies to some errors, but others you can get the full error message such as divide by zero etc ..exec msdb..sp_get_message_description 8134--Mohamed</description><pubDate>Wed, 14 Jan 2009 11:36:47 GMT</pubDate><dc:creator>mbenothmane</dc:creator></item><item><title>RE: Get Error Description in SQL Server 2000</title><link>http://www.sqlservercentral.com/Forums/Topic635145-1456-1.aspx</link><description>I ran sp_get_message_description 515and the O/PCannot insert the value NULL into column '%.*ls', table '%.*ls'; column does not allow nulls. %ls fails.Can you tell me how to fill out the missing values???</description><pubDate>Wed, 14 Jan 2009 11:22:22 GMT</pubDate><dc:creator>Mudassar Ahmed Khan</dc:creator></item><item><title>RE: Get Error Description in SQL Server 2000</title><link>http://www.sqlservercentral.com/Forums/Topic635145-1456-1.aspx</link><description>MS SQL 2000 already has system stored procedure in msdb that returns error description from messages table.  The system stored procedure is named "sp_get_message_description"</description><pubDate>Wed, 14 Jan 2009 11:04:59 GMT</pubDate><dc:creator>mbenothmane</dc:creator></item><item><title>RE: Get Error Description in SQL Server 2000</title><link>http://www.sqlservercentral.com/Forums/Topic635145-1456-1.aspx</link><description>Hi,Actually I had a need to get Exact Error Message and for Emailing. Since I had to give all functionality that a windows service would do.Otherwise I would had sticked to Windows Service.</description><pubDate>Tue, 13 Jan 2009 21:31:02 GMT</pubDate><dc:creator>Mudassar Ahmed Khan</dc:creator></item><item><title>RE: Get Error Description in SQL Server 2000</title><link>http://www.sqlservercentral.com/Forums/Topic635145-1456-1.aspx</link><description>The way I usually do things is to try to check return codes and handle the error at the procedure level...I code all my stored procs to return specific codes for specific errors.ex: [code]exec @ret = mydb.dbo.usp_procedure @arg1='foo'if @ret =  -1     RAISERROR('USP_PROCEDURE FAILED BECAUSE IT WAS TIRED', 16,1) WITH LOGif @ret = -2     RAISERROR('USP_PROCEDURE FAILED FOR SOME OTHER REASON', 16,1)  -- not specifying WITH LOG[/code]What this accomplishes is that you keep your error severity level in the 'user mode' and allows you to  be specific with your language when dealing with a specific stored procedure.... it also logs (or doesn't) depending on how you code it.... so for a less critical table, a 515 error might not be "log worthy" if you catch my meaning.It also enables you to move your database to a different server without as much trouble.</description><pubDate>Tue, 13 Jan 2009 15:32:28 GMT</pubDate><dc:creator>SQLBOT</dc:creator></item><item><title>RE: Get Error Description in SQL Server 2000</title><link>http://www.sqlservercentral.com/Forums/Topic635145-1456-1.aspx</link><description>The URL of the file ishttp://www.sqlservercentral.com/Files/sp_GetErrorDesc.sql/2268.sql</description><pubDate>Tue, 13 Jan 2009 11:01:55 GMT</pubDate><dc:creator>Mudassar Ahmed Khan</dc:creator></item><item><title>RE: Get Error Description in SQL Server 2000</title><link>http://www.sqlservercentral.com/Forums/Topic635145-1456-1.aspx</link><description>Its there in the Resources Section There's a link to download the file The File Name itself is the link Text sp_GetErrorDesc.sql Search for this sp_GetErrorDesc.sql</description><pubDate>Tue, 13 Jan 2009 10:59:21 GMT</pubDate><dc:creator>Mudassar Ahmed Khan</dc:creator></item><item><title>RE: Get Error Description in SQL Server 2000</title><link>http://www.sqlservercentral.com/Forums/Topic635145-1456-1.aspx</link><description>I was unable to find sp_GetErrorDesc in the resouce section.  Where should (url) I be looking?  A search on the procedure name returned no hits.-- Mark --</description><pubDate>Tue, 13 Jan 2009 10:42:23 GMT</pubDate><dc:creator>Mark D Powell</dc:creator></item><item><title>RE: Get Error Description in SQL Server 2000</title><link>http://www.sqlservercentral.com/Forums/Topic635145-1456-1.aspx</link><description>Yes I had a look. It is similar to mine. But I have not extracted any thing from it. If I had done so why would I post the article on same site.:)</description><pubDate>Mon, 12 Jan 2009 22:19:53 GMT</pubDate><dc:creator>Mudassar Ahmed Khan</dc:creator></item><item><title>RE: Get Error Description in SQL Server 2000</title><link>http://www.sqlservercentral.com/Forums/Topic635145-1456-1.aspx</link><description>Looks pretty familiar.[url=http://www.sqlservercentral.com/articles/Stored+Procedures/capturingtheerrordescriptioninastoredprocedure/1342/]http://www.sqlservercentral.com/articles/Stored+Procedures/capturingtheerrordescriptioninastoredprocedure/1342/[/url]</description><pubDate>Mon, 12 Jan 2009 21:52:44 GMT</pubDate><dc:creator>philcart</dc:creator></item><item><title>Get Error Description in SQL Server 2000</title><link>http://www.sqlservercentral.com/Forums/Topic635145-1456-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/articles/Error+Description/65013/"&gt;Get Error Description in SQL Server 2000&lt;/A&gt;[/B]</description><pubDate>Mon, 12 Jan 2009 21:45:26 GMT</pubDate><dc:creator>Mudassar Ahmed Khan</dc:creator></item></channel></rss>