0

I have seen many posts with "Unable to open Step output file.", but can't find any references where the step succeeded. I have my output file location set to:

$(ESCAPE_SQUOTE(SQLLOGDIR))\$(ESCAPE_SQUOTE(JOBNAME))_$(ESCAPE_SQUOTE(STEPID))_$(ESCAPE_SQUOTE(STRTDT))_$(ESCAPE_SQUOTE(STRTTM)).txt

Many other jobs on the same server are using the exact same output location (verified exact character match). This job is owned and being executed as the same user as the jobs which are successfully creating output files.

The job is performing a database restore of a user database with the job config pointed at the master database. This is the only job pointing at master, but I would be surprised if that made the difference.

Any thoughts?

  • 2
    I think I'd start by temporarily modifying the job to simply select your output location (surrounded with single quotes) to see what it resolves to. Perhaps there is something strange in your job name that can't resolve to part of a windows file path properly. – Scott Hodgin Jul 16 at 18:52
  • 1
    is it possible the job has no output thus not creating file? perhaps try adding select 1 to start of your query see if file is written. – Bob Klimes Jul 16 at 19:05
2

It was recommended that I review the job name for any characters that would resolve to a bad windows file path since I am using a variablized path. This ended up being due to a '/' in the SQL Server Agent Job name.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.