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 2000 Forums
 SQL Server Administration (2000)
 Copy One File Fromone Machine to another

Author  Topic 

AsimKhaliq
Yak Posting Veteran

94 Posts

Posted - 2004-07-09 : 13:02:38
Hi Guys

I wanna copy one file from my server machine to another machine thru SQL server Stroed Procedure.

Plz Help Me
Thnx

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-07-09 : 13:10:13
You need to use xp_cmdshell for this. You can use xcopy or robocopy in xp_cmdshell.

Tara
Go to Top of Page

AsimKhaliq
Yak Posting Veteran

94 Posts

Posted - 2004-07-09 : 13:35:39

iam running this
exec xp_cmdshell 'xcopy /Y c:\abc.dat \\servername\sharename\xyz.dat';
but its giving me invalid drive specification

Thnx again
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-07-09 : 13:39:38
xp_cmdshell runs from the database server and not from the client machine. The path information must be valid in the database server's perspective. The MSSQLSERVER service account also must have access to the remote location as that is what runs xp_cmdshell.

Tara
Go to Top of Page
   

- Advertisement -