Sunday, July 17, 2011

Using xp_cmdshell for backup xcopy gives "Invalid drive specification"

PROBLEM:
When I do this, I get an error back that says "Invalid drive specification" so I verified that both UNC Paths were correct by copying and pasting each one into a Run window and each opened up the correct directory.
I typed out the xcopy command in a command prompt on my machine without ANY changes and the command executed fine.

SOLUTION:
SQL is executing the command shell under the account that the SQL service was started under. The SQL server service is running under a local account, not a domain account. Thus it can't see the domain thus it can't find the path you’re looking for. Check what account the service is running under.


If you find this solution useful, you are welcome to press one of the ads in this page.. Thanks!


No comments:

Post a Comment