SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Miant Plan -batch file execution


Miant Plan -batch file execution

Author
Message
sps-554505
sps-554505
Mr or Mrs. 500
Mr or Mrs. 500 (513 reputation)Mr or Mrs. 500 (513 reputation)Mr or Mrs. 500 (513 reputation)Mr or Mrs. 500 (513 reputation)Mr or Mrs. 500 (513 reputation)Mr or Mrs. 500 (513 reputation)Mr or Mrs. 500 (513 reputation)Mr or Mrs. 500 (513 reputation)

Group: General Forum Members
Points: 513 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
Carolyn Richardson
Carolyn Richardson
Hall of Fame
Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)

Group: General Forum Members
Points: 3753 Visits: 3569
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
Alan. T.
Alan. T.
UDP Broadcaster
UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)

Group: General Forum Members
Points: 1493 Visits: 652
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.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search