Link to home
Start Free TrialLog in
Avatar of Jan Mishkin
Jan MishkinFlag for United States of America

asked on

BCP works fine but dosen't work

This command runs without error
Exec master..xp_cmdShell 'bcp "select * from MyDB.dbo.ftpinf" queryout C:\test.txt -c -T'

the bcp runs fine. No errors but also no file is created?!!?

heres the result
NULL
Starting copy...
NULL
4 rows copied.
Network packet size (bytes): 4096
Clock Time (ms.) Total     : 1      Average : (4000.00 rows per sec.)
NULL

Any ideas??
Avatar of GMGenius
GMGenius
Flag of United Kingdom of Great Britain and Northern Ireland image

I think your problem is the file path
Try a drive and folder not on C:\ root
Are you running the commands directly on the server or on a client ?  This command will place the output file on the c drive of the sql server, not on the c drive of your client where you are running ssms.  
ASKER CERTIFIED SOLUTION
Avatar of Jan Mishkin
Jan Mishkin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial