Avatar of Jan Mishkin
Jan Mishkin
Flag 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??
Microsoft SQL Server 2005Microsoft SQL Server 2008

Avatar of undefined
Last Comment
Jan Mishkin

8/22/2022 - Mon
GMGenius

I think your problem is the file path
Try a drive and folder not on C:\ root
robertg34

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
Jan Mishkin

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck