Wednesday, March 7, 2012

DTS not running on a mapped drive

I created a DTS local package on the SQL Server. It's basically importing a text file into a table in my database. This file resides in a mapped drive (X:) from another server. When I schedule the DTS as a job, it fails. It doesn't execute any of the workflow in the design.

However, when I copy the text file into a drive local to the SQL server (D:), it runs flawlessly.

What I do right now is I have a windows scheduled task that runs a batch file that copies the text file from X: to D: at certain time intervals. Then the job scheduler runs to import it.

What am I missing? How come the job scheduler can't read the file directly from the mapped drive?

Any info would be appreciated. TIAWhat am I missing? How come the job scheduler can't read the file directly from the mapped drive?

Any info would be appreciated. TIA

A mapped drive only exists in the context of your login session. You will need to use a UNC path to reference the file:

\\MyServer\ServerShare\Path\FileName.txt

Alternatively (NOT recommended), you can use the command NET USE, but you are much better off using UNC.

Regards,

hmscott|||Thanks - that worked for me.

No comments:

Post a Comment