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
You can't, unless the procedure has code to write to the error log, or it results in a certain severity.
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