Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12»»

Get Error Description in SQL Server 2000 Expand / Collapse
Author
Message
Posted Monday, January 12, 2009 9:45 PM


Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, December 9, 2013 2:25 AM
Points: 8, Visits: 36
Comments posted to this topic are about the item Get Error Description in SQL Server 2000
Post #635145
Posted Monday, January 12, 2009 9:52 PM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: 2 days ago @ 10:44 PM
Points: 2,693, Visits: 1,213
Looks pretty familiar.

http://www.sqlservercentral.com/articles/Stored+Procedures/capturingtheerrordescriptioninastoredprocedure/1342/



Hope this helps
Phill Carter
--------------------
Colt 45 - the original point and click interface

Australian SQL Server User Groups - My profile
Phills Philosophies
Murrumbeena Cricket Club
Post #635146
Posted Monday, January 12, 2009 10:19 PM


Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, December 9, 2013 2:25 AM
Points: 8, Visits: 36
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.:)
Post #635151
Posted Tuesday, January 13, 2009 10:42 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: 2 days ago @ 2:00 PM
Points: 1,384, Visits: 402
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 --
Post #635644
Posted Tuesday, January 13, 2009 10:59 AM


Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, December 9, 2013 2:25 AM
Points: 8, Visits: 36
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
Post #635663
Posted Tuesday, January 13, 2009 11:01 AM


Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, December 9, 2013 2:25 AM
Points: 8, Visits: 36
The URL of the file is
http://www.sqlservercentral.com/Files/sp_GetErrorDesc.sql/2268.sql
Post #635666
Posted Tuesday, January 13, 2009 3:32 PM


SSChasing Mays

SSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing Mays

Group: General Forum Members
Last Login: Friday, January 3, 2014 10:59 AM
Points: 626, Visits: 836
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:
exec @ret = mydb.dbo.usp_procedure @arg1='foo'
if @ret = -1
RAISERROR('USP_PROCEDURE FAILED BECAUSE IT WAS TIRED', 16,1) WITH LOG
if @ret = -2
RAISERROR('USP_PROCEDURE FAILED FOR SOME OTHER REASON', 16,1) -- not specifying WITH LOG

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.


Craig Outcalt



Tips for new DBAs: http://www.sqlservercentral.com/articles/Career/64632
My other articles: http://www.sqlservercentral.com/Authors/Articles/Craig_Outcalt/560258
Post #635884
Posted Tuesday, January 13, 2009 9:31 PM


Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, December 9, 2013 2:25 AM
Points: 8, Visits: 36
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.
Post #635996
Posted Wednesday, January 14, 2009 11:04 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, June 2, 2011 3:09 PM
Points: 111, Visits: 82
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"


Post #636485
Posted Wednesday, January 14, 2009 11:22 AM


Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, December 9, 2013 2:25 AM
Points: 8, Visits: 36
I ran sp_get_message_description 515

and the O/P
Cannot 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???

Post #636499
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse