|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Sunday, June 13, 2010 7:18 AM
Points: 8,
Visits: 35
|
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Today @ 2:22 AM
Points: 2,693,
Visits: 1,081
|
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Sunday, June 13, 2010 7:18 AM
Points: 8,
Visits: 35
|
|
| 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.:)
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Monday, June 10, 2013 12:39 PM
Points: 1,266,
Visits: 343
|
|
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 --
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Sunday, June 13, 2010 7:18 AM
Points: 8,
Visits: 35
|
|
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
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Sunday, June 13, 2010 7:18 AM
Points: 8,
Visits: 35
|
|
The URL of the file is http://www.sqlservercentral.com/Files/sp_GetErrorDesc.sql/2268.sql
|
|
|
|
|
SSChasing Mays
      
Group: General Forum Members
Last Login: Monday, February 18, 2013 3:22 PM
Points: 626,
Visits: 835
|
|
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
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Sunday, June 13, 2010 7:18 AM
Points: 8,
Visits: 35
|
|
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.
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Thursday, June 02, 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"
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Sunday, June 13, 2010 7:18 AM
Points: 8,
Visits: 35
|
|
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???
|
|
|
|