Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 SQL Server Agent Error

Author  Topic 

joyce.hughes
Starting Member

1 Post

Posted - 2014-07-02 : 13:54:40
Please help. I am pulling my hair out!

I have tried various commands in my step for a job and keep getting variouos errors.

(I did the following from a command prompt in SQL)
ex: robocopy d:Imports d:Imports\OLD Import*.xls /MOV
error: Msg 102, Level 15, State 1, Line 2
Incorrect syntax near 'Imports'.
Msg 132, Level 15, State 1, Line 2
The label 'd' has already been declared. Label names must be unique within a query batch or stored procedure.

(I did the command within the Step)
ex: robocopy "D:Imports Import*.*" "D:\Imports\OLD\*.*" /MOV
error: Message
Executed as user: NMED\nmcsd.devsql. The process could not be created for step 3 of job 0x099906A8D9C57C419BA713A29DF9022C (reason: The system cannot find the file specified). The step failed.

The path for the file is D:\Imports
The destination path is D:\Imports\OLD

I want to move the file from Imports to OLD, then delete it from Imports. I would appreciate any help. Thanks.

James K
Master Smack Fu Yak Hacker

3873 Posts

Posted - 2014-07-02 : 14:05:46
Since you are getting errors when you try to run the command line, that needs to be fixed first. Don't you need a back slash? E.g., instead of
robocopy d:Imports d:Imports\OLD Import*.xls /MOV
this:
robocopy d\:Imports d\:Imports\OLD Import*.xls /MOV
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2014-07-02 : 14:06:40
robocopy d:\Imports d:\Imports\OLD *.xls /MOV

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2014-07-02 : 14:07:03


Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page
   

- Advertisement -