June 23, 2011 at 8:14 am
Hi
I need to copy some txt files from sql server to another server.
Thought that would be easy but no....
Using xp_cmdshell for this
USE master;
EXEC xp_cmdshell 'copy C:\CSVFILES\customerroutes.txt
\\common\customerimport, NO_OUTPUT';
It report success, but when I look in \\common\customerimport I see no file.
Any one know why?
Dan
June 23, 2011 at 8:23 am
remove the nooutput so you can see what's going on.
You could also run that from the real cmd line so you get the real error message (if there's one)
June 23, 2011 at 8:32 am
Hi
Tried without the no output. But no error meassge.
Also I started command promt and typed it in as plain command
That works just fine.
Dan
June 23, 2011 at 8:38 am
Try doing a dir in both folders. That should show you access denied error.
June 23, 2011 at 9:05 am
Don't you need a destination file name (not just a folder) to make that command work correctly?
Does SQL have permissions to write to that destination?
June 23, 2011 at 9:16 am
Thanks Brandie, that solved my issue. 🙂
Dan
June 23, 2011 at 9:28 am
I've delete that job but I swear I've already done something similar to this :
MOVE c:\backups\*.bak D:\backups[\].
I'm 99.9% sure that you don't need a destination name for the file.
June 23, 2011 at 10:32 am
Dan-Ketil Jakobsen (6/23/2011)
Thanks Brandie, that solved my issue. 🙂
Which question solved your issue? I'm curious.
June 23, 2011 at 10:32 am
Ninja's_RGR'us (6/23/2011)
I've delete that job but I swear I've already done something similar to this :MOVE c:\backups\*.bak D:\backups[\].
I'm 99.9% sure that you don't need a destination name for the file.
MOVE isn't the same as COPY necessarily.
June 24, 2011 at 12:57 am
Brandie Tarvin (6/23/2011)
Dan-Ketil Jakobsen (6/23/2011)
Thanks Brandie, that solved my issue. 🙂Which question solved your issue? I'm curious.
Brandie.
I had to ad the file name at the end.
Dan
Viewing 10 posts - 1 through 9 (of 9 total)
You must be logged in to reply to this topic. Login to reply