SQL Jobs output file

  • I have a schedule SQL jobs that run daily at 2 AM, i want the output file to be save individually with name and date example "File name 25-11-2017" on a daily basis meaning i want one file per day to be save in the folder. There are 2 option could be select, append to existing or overwrite and none of the option meet my requirement. TIA.

  • You will need to token'ise the output file, something like the below to input a dynamic date and time value

    C:\JobOutputFiles\DatabaseBackup_$(ESCAPE_SQUOTE(JOBID))_$(ESCAPE_SQUOTE(STEPID))_$(ESCAPE_SQUOTE(STRTDT))_$(ESCAPE_SQUOTE(STRTTM)).txt

  • anthony.green - Sunday, November 26, 2017 11:39 PM

    You will need to token'ise the output file, something like the below to input a dynamic date and time value

    C:\JobOutputFiles\DatabaseBackup_$(ESCAPE_SQUOTE(JOBID))_$(ESCAPE_SQUOTE(STEPID))_$(ESCAPE_SQUOTE(STRTDT))_$(ESCAPE_SQUOTE(STRTTM)).txt

    Thanks anthony.green!

Viewing 3 posts - 1 through 2 (of 2 total)

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