How can I see a list of stored procedure errors over a given timespan in SQL Server Management Studio 2008?

closed as off-topic by Shanky, Max Vernon, RLF, Paul White, dezso Jun 3 '15 at 7:54

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Too localized - this could be because your code has a typo, basic error, or is not relevant to most of our audience. Consider revising your question so that it appeals to a broader audience. As it stands, the question is unlikely to help other users (regarding typo questions, see this meta question for background)." – Shanky, Max Vernon, RLF, dezso
If this question can be reworded to fit the rules in the help center, please edit the question.

You can't, unless the procedure has code to write to the error log, or it results in a certain severity.

Investigate using TRY...CATCH error handling. You should be able to capture errors and then write those to the error log.

You can look in sql server logs:

AS stated in MS article:

View the SQL Server error log to ensure that processes have completed successfully (for example, backup and restore operations, batch commands, or other scripts and processes). This can be helpful to detect any current or potential problem areas, including automatic recovery messages (particularly if an instance of SQL Server has been stopped and restarted), kernel messages, or other server-level error messages.

View the SQL Server error log by using SQL Server Management Studio or any text editor. By default, the error log is located at Program Files\Microsoft SQL Server\MSSQL.n\MSSQL\LOG\ERRORLOG and ERRORLOG.n files.

If its not at default location, query below to find the location of you're logs:

USE master
GO
xp_readerrorlog 0, 1, N'Logging SQL Server messages in file', NULL, NULL, N'asc' 
GO

Also, recommend to read this article for same: Simple process to track and log SQL Server stored procedure use and Easy way to track Stored Procedure errors in MS SQL Server 2008

  • Is there is a simple way to wrap my own procedure into other one and track its errors ? For example i call proc1 where proc2 is parameter ? – Vladislav Furdak Jun 2 '15 at 16:00
  • 1
    It's worth noting the SQL Server Error Log won't record all problems that might occur during the execution of a stored procedure. For instance, if the stored proc encounters a row containing a null value where the code doesn't handle nulls - that won't be recorded in the Error Log. – Max Vernon Jun 2 '15 at 16:22

Not the answer you're looking for? Browse other questions tagged or ask your own question.