I have two different problem with BCP.
1. See the following command I am using to run BCP - queryout option. When I am using same thing on command prompt, it works fine but when I tried to run through query analyzer using xp_cmdshell sp, it says 0 rows affected and it didn't created any file. Its not giving me any error. Any Idea?
exec xp_cmdshell 'bcp "select * from pubs..authors" queryout c:\authors.txt -c -q -SSQLDev -U"Test1" -P"12345"'
This is on one machine.
2. Second one -- This is on another machine.
It works fine when I user this on command prompt
bcp "pubs.dbo.authors" out authors.txt -c -q -SSQLDev -U"test1" -P"12345"
But gives errors when I run this on command prompt:
bcp "select * from pubs.dbo.authors" queryout c:\authors.txt -c -q -SSQLDev -U"test1" -P"12345"
This is the Error:
Bcp has generated errors & will be closed by Windows. You will need to restart the program.
Any Idea ?
Note : I tired 1 & 2 on two different machine. Both machine are connect to SQL Server 7 but SQL 2000 client installed.