Link to home
Start Free TrialLog in
Avatar of Jasmine Sandlas
Jasmine SandlasFlag for Oman

asked on

Executing SQL Agent Job on Server10 | Moving Files on Server11 | Please Help | URGENT

I have a SQL agent job (test.sql) which is on  server10.

I have a source file(Dummy_Test) in AB folder\srcfiles, I need to move that to AB\TgtFiles. This folder is located on server 11.

How can I move them? Please help
I am using and running sql agent job test.sql on server10 which has below mentioned code in one of the step.

move '\\server11.a.b.com\shared\AB\SrcFiles\Dummy_Test' '\\server11.a.b.com\shared\AB\TgtFiles\Dummy_Test'

--- It says syntax error.

Please help, is it possible to do this? or am I missing something?
Avatar of Scott Pletcher
Scott Pletcher
Flag of United States of America image

If the file doesn't have an extension -- rather than just the extension not showing because of folder/other view settings -- then maybe just dbl quotes instead of single:

move "\\server11.a.b.com\shared\AB\SrcFiles\Dummy_Test" "\\server11.a.b.com\shared\AB\TgtFiles\Dummy_Test"
Avatar of Jasmine Sandlas

ASKER

I am sorry. I changed it to double quotes and it FAILED again.
"It FAILED" doesn't tell my anything:

What was the error message?
Did you verify that the id running the task has proper permissions to both paths?
Did you verify that the file name really doesn't have an extension?
Yes, it failed again with the same error "Incorrect Syntax"
...have included the file extension as well.

...I guess if there would have been a permission issues, the error was "Access Denied" - Correct me if I am wrong here.


Now passing:-

move "\\server11.a.b.com\shared\AB\SrcFiles\Dummy_Test.txt" "\\server11.a.b.com\shared\AB\TgtFiles"
ASKER CERTIFIED SOLUTION
Avatar of Scott Pletcher
Scott Pletcher
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
It is an OS step.
Hmm, yeah, I don't see a "syntax error" in that command either.
Please provide the complete command and respective full error message.
thanks