Home Forums SQL Server 2005 Development Output a sql resultset to csv automatically with sql job RE: Output a sql resultset to csv automatically with sql job

  • That is the code I'm using. In the SQL job's step, I have the following code:

    exec xp_cmdshell "d:\sqlcode\runsql.bat"

    The .bat file code is the following:

    sqlcmd -S ECOM-VS-01 -i "d:\sqlcode\backorder.sql" -o "\\temp-shed-40\public\backorder.csv" -s"," -h-1 -W

    This still gave me the same error.

    Executed as user: PROFUNI\ECOMSA01. The process could not be created for step 1 of job 0x9278D1451C7AE845801DDA940E5F4EA0 (reason: The system cannot find the file specified). The step failed.

    PROFUNI/ECOMSA01 has write access to the temp-shed-40 location.

    Any ideas would be appreciated?

    Jason