|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Saturday, September 12, 2009 9:12 PM
Points: 65,
Visits: 224
|
|
HI,
I have one batch file which copies data from from one folder to tape drive, while running manualy it si wworking fine ,it is removing the data and moving into tape
i would like to add this task after the backup of the job,so i created 1 maint plan and try to add the below comments it is not working,can anyone suggest Use master exec xp_cmdshell 'G:\MSSQL\file.bat' go
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Yesterday @ 4:52 AM
Points: 1,397,
Visits: 2,738
|
|
If you run the command on its own through Management Studio what message do you get?
Facts are stubborn things, but statistics are more pliable - Mark Twain Carolyn SQLServerSpecialists
|
|
|
|
|
Say Hey Kid
      
Group: General Forum Members
Last Login: Thursday, May 09, 2013 12:56 PM
Points: 684,
Visits: 605
|
|
A few things you need to look at as long as the file runs fine when you run it.
1. What user is the SQL server agent running as? If the tape drive is not local you will need a user that can access the tape drive. 2. If it is running as a user log into the machine as that user and see if the script works.
The command shell will run with the authority of calling user so you probably need to look there. Use the configuration manager to change it and this should clear it up.
I have also found that making sure SP2 is installed as this has solved a lot of problems for me.
|
|
|
|