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?
Jasmine SandlasAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Scott PletcherSenior DBACommented:
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"
0
Jasmine SandlasAuthor Commented:
I am sorry. I changed it to double quotes and it FAILED again.
0
Scott PletcherSenior DBACommented:
"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?
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Jasmine SandlasAuthor Commented:
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"
0
Scott PletcherSenior DBACommented:
Hmm, that's not a typical OS error message.

Is the job step type "Transact-SQL script (T-SQL)" or "Operating system (CmdExec)"?  It needs to be an OS step, not a T-SQL step.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Jasmine SandlasAuthor Commented:
It is an OS step.
0
Scott PletcherSenior DBACommented:
Hmm, yeah, I don't see a "syntax error" in that command either.
0
Vitor MontalvãoMSSQL Senior EngineerCommented:
Please provide the complete command and respective full error message.
0
Jasmine SandlasAuthor Commented:
thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
SQL

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.