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
 Transact-SQL (2005)
 Running a Batch File

Author  Topic 

rcr69er
Constraint Violating Yak Guru

327 Posts

Posted - 2008-03-10 : 11:52:59
Hi

Is it possible using T-SQL to run a batch file located on different server, ie. PC1 has SQL Server on it, PC2 has the batchfile, I need to run the batchfile stored on PC2 on PC1.

Thanks

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-03-10 : 12:02:19
Try using xp_cmdshell extended stored proc for this
Go to Top of Page

rcr69er
Constraint Violating Yak Guru

327 Posts

Posted - 2008-03-10 : 12:22:21
Hi

I tried using the following syntax:

EXEC master..XP_CMDShell '\\hit1\DEV\Archiving\ArchivingDataFiles.zipdata.bat'

But it failed saying that it is not recognised as an internal or external command.

Any ideas???

Thanks
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-03-10 : 12:31:50
Try these options:-

http://support.microsoft.com/kb/297368
Go to Top of Page
   

- Advertisement -