April 18, 2007 at 11:08 am
I have files being stored on a Shared folder on one server, and need to copy those files over to the share on My other server. What would the T-SQL look like to achieve this?
Thanks,
NoOB
April 18, 2007 at 11:12 am
Assuming that this is a repeating process, I'd create a batch file, using UNC names, and call that with xp_cmdshell. Then, any changes you want to make only need to be made in the batch file.
If it's a one time thing, I'd bypass T-SQL completely and let the OS do it.
April 18, 2007 at 11:16 am
im setting up a procedure to move the file on a daily basis as a new file is loaded in that folder daily
April 18, 2007 at 11:22 am
Then I'd personally go with the batch file. You can even call it from a job if you'd like.
April 18, 2007 at 11:25 am
but what would the batch file look like. stuck on the syntax
April 18, 2007 at 11:30 am
XCOPY \\sourceserver\sourcevolume\sourcepath\sourcefilename \\destinationserver\destinationvolume\destinationpath\destinationfilename
You can use COPY instead of XCOPY, but I use XCOPY as it gives more switches that I may or may not need down the road.
April 18, 2007 at 11:34 am
awesome, thank you very much
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply