question

swarnava2004 avatar image
swarnava2004 asked

Where does SQL server store job failure error messages?

I have a job that inserts records in 10 tables every day at 10 pm. However, if any insertion in any table fails the job stops. I want to know what is the cause of failure. Where does SQL server store the error messages?
insertsql-agentjobs
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

This site functions according to votes. For all helpful answers below, show this by clicking on the thumbs up next to those answers. If any one answer lead to a solution, indicate this by clicking on the check mark next to that answer.
0 Likes 0 ·
@SQLShark avatar image
@SQLShark answered
Hi there, If you open up SQL Agent, then dbl click on Job activity monitor, this will have a list of all you jobs. Right click on the job that failed and view the history. Expand the drop downs to see where your error is. If you need to use TSQL then there are some [tips][1] here. Hope that helps. [1]: http://www.mssqltips.com/sqlservertip/2561/querying-sql-server-agent-job-information/
2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hi, Thanks for the reply. The job which is inserting records in sql tables is a scheduled windows job (written in vb script) not sql server job. Now if any insertion fails in any table, how will i get the error?
0 Likes 0 ·
To view the SQL Server error log In Object Explorer, expand a server, expand Management, and then expand SQL Server Logs. Right-click a log and click View SQL Server Log.
0 Likes 0 ·
David Wimbush avatar image
David Wimbush answered
I'd suggest moving this work into a SQL Agent job. A job can have VB Script steps. That way you can pipe the output to a file and set the job to email you if it fails. Then you can read the log file to get the details.
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Thanks David....
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.