?
Solved

SP exceptional flow control

Posted on 2012-04-10
2
Medium Priority
?
249 Views
Last Modified: 2012-04-12
Dear all DB expertist,

right now we have a system workflow monitoring tools called control-M, all our housekeeping job is running in a store procedure and we can see the the exeception flow control is not very good.

How can we improve the execeptional flow control the return as much information as possible when the SP failed to the monitoring system ? the Control-M.

All solution is welcome and I will try it one by one.

DBA100.
0
Comment
Question by:marrowyung
2 Comments
 
LVL 28

Accepted Solution

by:
Ryan McCauley earned 1000 total points
ID: 37830096
I'm a big fan of TRY/CATCH blocks in newer versions of SQL Server. You can nest them if you want, and they provide excellent control over the flow of your T-SQL code when there's the possibility of an error.

Once you can control the flow sufficiently, you can use the RAISERROR keyword (note the mis-spelling - it's on purpose) to throw information of interest back to the control process that's calling the SP in the first place. Those details and the associated messages or codes can be logged and reported on at the application level.

Check out the link above for some examples of both RAISERROR and TRY/CATCH blocks to capture errors and report them.
0
 
LVL 43

Assisted Solution

by:Eugene Z
Eugene Z earned 1000 total points
ID: 37830227
please tell more about about this control-m and the execeptional flow control  that you have now:
check:

SQL Server 2008 error handling best practice
http://blogs.msdn.com/b/anthonybloesch/archive/2009/03/10/sql-server-error-handling-best-practice.aspx

http://www.sqlteam.com/article/handling-sql-server-errors
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question