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
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Unable to Transfer .Zip file to the another Server

Author  Topic 

bhushan_juare
Starting Member

45 Posts

Posted - 2012-07-06 : 07:16:49
Hi Everyone,

I have created a batch file which runs on remote server via SQL job
Step 1) Create connection string and Maintaince Plan i.e. SSIS package
Step 2) Unzip program using BATCH file and transfer ZIP file to other Remote Server.
Now problem is when i execute BATCH file manually its working fine..
But, when i created SQL job and use xp_cmdshell in it its goin worthless..i dont know what went wrong...

Thanks....

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-07-06 : 09:40:10
does service account you use for running job has enough privledges to execute cmdshell? are you getting any error messages in sql job history log?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

jackv
Master Smack Fu Yak Hacker

2179 Posts

Posted - 2012-07-06 : 10:58:43
Type xp_cmdshell 'ipconfig' - for the appropriate logon . If you get something like :
Msg 15281, Level 16, State 1, Procedure xp_cmdshell, Line 1
SQL Server blocked access to procedure 'sys.xp_cmdshell' of component 'xp_cmdshell' because this component is turned off as part of the security configuration for this server.

Then your permissions are inappropriate

Jack Vamvas
--------------------
http://www.sqlserver-dba.com
Go to Top of Page

bhushan_juare
Starting Member

45 Posts

Posted - 2012-07-07 : 03:32:27
Where i suppose to type xp_cmdshell ?
Could you please elaborate it...
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-07-07 : 17:12:02
quote:
Originally posted by bhushan_juare

Where i suppose to type xp_cmdshell ?
Could you please elaborate it...



inside your proc or query.

see
http://www.databasejournal.com/features/mssql/article.php/3372131/Using-xpcmdshell.htm

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

jackv
Master Smack Fu Yak Hacker

2179 Posts

Posted - 2012-07-08 : 01:29:09
Yes, open SSMS (although you could try with SQLCMD) , connect to SQL Server instance - and type the command posted above

Jack Vamvas
--------------------
http://www.sqlserver-dba.com
Go to Top of Page

IowaTechBear
Starting Member

2 Posts

Posted - 2012-07-19 : 12:58:14
What do your error and server logs say? It could be a permissions problem, a configuration issue with xp_cmdshell. Either one will give different error messages.
Go to Top of Page
   

- Advertisement -