We help IT Professionals succeed at work.

BCP works fine but dosen't work

441 Views
Last Modified: 2012-06-21
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??
Comment
Watch Question

GMGeniusSoftware Development Manager/Developer
CERTIFIED EXPERT

Commented:
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.  
IT Manager
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.