Monday, March 19, 2012

Make SQL Agent use drive mapping?

Good day,
I'm migrating our current SQL 2k box (running on win 2000) to a new Windows 2003 server. I'm having trouble getting the SQL agent to use the servers drive mapping when running jobs. The odbc driver that I'm using does not support UNC paths. I know, dri
ve mapping are not cool becuase we have to keep the server logged in but it's the only way and it does work on our old box. The weird thing is that I can't get this working on the new server. On the old box the SQL Agent is set to run as the same accoun
t as the logged in user and it can access the drive mappings fine, it's been running this way for quite some time. However, on my new box this does not work...is this a windows 2003 server thing? I'm runing SQL 2k SP3 on both boxes. Also, the new box i
n not in a domain so the account I'm trying to use is a local admin acount.
Any ideas?
Drive mappings are not guaranteed to work when being accessed from a
service. There is no way to force them to work.
Rand
This posting is provided "as is" with no warranties and confers no rights.
|||I figured it out. I simply added a step in each scheduled job to create and then delete the drive mapping.
For example, I just use the "net use f: \\server\volume" to create the drive ampping an then excute the rest of my job steps and then use another step with this command "net use f: /delete" to delete it. Becuase the SQL Agent service is excuting the comm
and the drive mapping is in it's session and it works every time. It's nice becuase the drive mapping isn't even seen by the desktop and works when the server in not logged in. I remove the drive mapping at the end of each job becuase the drive mapping
remains in tack as long as the SQL agent service stays running and therefore if another job runs and tries to re-create the drive mapping the job will fail.

No comments:

Post a Comment