January 22, 2013 at 11:13 am
Does anyone knows a way to handle errors in eg. stored procedure, function or trigger in a generic way?
Would it be possible to implement this once. I understand that a DB trigger is not the solution.
Would be neat if this was possible.
The only way I know is a try & catch in each object.
Hope someone knows a better / more generic way.
Harry
January 22, 2013 at 1:11 pm
Harry Drenth (1/22/2013)
Does anyone knows a way to handle errors in eg. stored procedure, function or trigger in a generic way?Would it be possible to implement this once. I understand that a DB trigger is not the solution.
Would be neat if this was possible.
The only way I know is a try & catch in each object.
Hope someone knows a better / more generic way.
Harry
This kind of thing works well in applications but in the database it is not a great idea. Errors need to be known about in the applications that are using the database. If you were to graciously handle errors at the data level your applications would hum along blindly thinking nothing went wrong. Seems like a dangerous thing to me.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply