Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Check stpr for errors inside another stored proc

Author  Topic 

mea104
Starting Member

2 Posts

Posted - 2011-07-12 : 14:20:48
Without printing the result set to screen. I dont want to modify the stored procedure that Im checking. My purpose is to write a stored procedure that checks a group (maybe 5 - 10) stored procedures at once just to see if any of them fail, and hence cause the screen to crash. I pass in the parameters, and they all have same parameters. But how can i chekc them withouot having them print all the results to the screen. I just want to check for errors

Go Bears

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-07-12 : 14:33:10
Well you'll still get whatever output those have, but wrap your EXEC statements into a TRY/CATCH block.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

mea104
Starting Member

2 Posts

Posted - 2011-07-12 : 15:03:02
I appreciate ur input but im already doing that. Thats as far as I have gotten and I am doing the pretty much standard SELECT
ERROR_NUMBER() AS ErrorNumber
,ERROR_SEVERITY() AS ErrorSeverity
,ERROR_STATE() AS ErrorState
,ERROR_PROCEDURE() AS ErrorProcedure
,ERROR_LINE() AS ErrorLine
,ERROR_MESSAGE() AS ErrorMessage;
during the catch. I really dont want 10 stored procedures output ot come to the screen tho

Go Bears
Go to Top of Page
   

- Advertisement -