Exporting SQL Jobs history

  • Hi,

    I know how to export a SQL Server job's history to a file by clicking on the Export button inside the log file history viewer.

    But how can I automate this process.

    So for example to export history data every 2 days into my file automatically when the job finishes running.

    Thanks.

  • you can automate the process by using msdb system tables sysjobhistory and export the data from it according to your filter and requirement.

  • I can export into a table using SELECT INTO but how can I export into a file using TSQL?

  • You could export to a file with BCP, or create a SSIS package.

  • Ok thanks.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply