Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Miant Plan -batch file execution Expand / Collapse
Author
Message
Posted Friday, June 27, 2008 6:16 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued 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
Post #524907
Posted Friday, June 27, 2008 6:47 AM
UDP Broadcaster

UDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP Broadcaster

Group: General Forum Members
Last Login: Tuesday, July 8, 2014 12:52 AM
Points: 1,454, Visits: 2,959
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
Post #524931
Posted Friday, June 27, 2008 7:21 AM
Say Hey Kid

Say Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey Kid

Group: General Forum Members
Last Login: Yesterday @ 7:55 AM
Points: 684, Visits: 617
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.

Post #524967
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse