How to insert log values into a sql table in SQL Server 2008 R2?
I created a package and scheduled it to run daily at 11:00pm. I wanted to have the log values in a SQL Server table. Meaning after my scheduled job has run, the Job Name, Date run, Message(success or failure) values should insert into a SQL table. I have to create a SSRS report on this table. Please let me know how to do this.
July 2nd, 2011 10:13am

You can do it by yourself: create one or more (depends on failure or success) ExecuteSQL Task and insert the Loginfo in a table Or you can enable the Package Logging and provide the Loginfo into the table, the SSIS will create.
Free Windows Admin Tool Kit Click here and download it now
July 2nd, 2011 10:16am

Which one is the efficient way to do? Can you tell me how to enable the package logging? Will this insert all the logs into a table? I just need to insert the JOB NAME, DATE RUN and FINAL MESSAGE(failure or success) values every time the SQL Agent job has run my scheduled job.
July 2nd, 2011 10:33am

Please help me with this.
Free Windows Admin Tool Kit Click here and download it now
July 2nd, 2011 11:15am

Package Logging has to enabled in SSIS-Package. If you only need Jobname, Starttime, Endtime and Message: add an ExecuteSQL Task at the beginning of the package: insert into myLogTable (...) select 'MyJob',getdate(),'Start' After the last Step in package add two ExecuteSQL Task: 1. insert into myLogTable (...) select 'MyJob',getdate(),'End' to this Task set the Success-Constraint 2. insert into myLogTable (...) select 'MyJob',getdate(),'Fail' to this Task set the Failure-Constraint Other way, extract these infos from the jobhistory: select * from msdb.dbo.sysjobhistory where job_name = 'MyJob'
July 2nd, 2011 1:29pm

Thanks for your help.
Free Windows Admin Tool Kit Click here and download it now
July 2nd, 2011 4:24pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics