I'm a bcp newbie (i.e. I've never actually used it before) and I'm having some trouble. I'm trying to use it from the command line so that I can understand it enough to create batch files later. I'm able to use sqlcmd just fine, but using the same info to try and use bcp doesn't seem to work.
The command that I'm using for sqlcmd is as follows:
Code:
sqlcmd -S MySqlServer -U MyUsername -P MyPassord
(Of course those aren't the actual values I'm using, but you get the idea). This connects fine, and to test it I've selected a few rows from a few different tables. Everything works fine. I then quit and try to use bcp with something like the following:
Code:
bcp MyDatabase.dbo.MyTable out MyOutput.txt -S MySqlServer -U MyUsername -P MyPassword
(just to verify, I'm trying to output the table to the file, so I use "out" right?) This gives the following error:
Code:
CTLIB Message: - L6/08/S5/N3/5/0:
ct_connect(): directory service layer: internal directory control layer error: Requested server name not found.
Establishing connection failed.
Presumably if sqlcmd is able to connect, then the server MySqlServer is a valid server name and so bcp should be able to connect as well, right? Or is there additional information that bcp needs to have?