SQL Server 2005. I have inherited some SQL Agent jobs which have multiple steps with each step containing multiple stored procedure executes. This all works fine, but is a headache when one of the sp executes fail as I have to trawl through all the sp's looking for the one that failed (as SQL Agent simply reports the step that fails and the reason for failure). In an ideal world these sp's would be split into separate steps, but I cannot do this. So, my question is this ... Is there a means of writing to the SQL Agent log so I can trace which sp execute has been started. Is there anything along the lines of the ECHO command in DOS that could be used between each sp execute to update the log?
Asked
Active
Viewed 28 times
0
-
1http://stackoverflow.com/questions/21532811/sql-server-agent-jobs-log-custom-messages-in-job-history , http://sqlmag.com/blog/semi-advanced-logging-options-sql-server-agent-jobs – Mitch Wheat Oct 14 '15 at 09:15
-
Thanks @Mitch Wheat! I'd used PRINT previously as a means on logging SQL output to text, but had not realised that it could also be used to create a log in SQL Agent. – MiguelH Oct 14 '15 at 09:27