Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 executing bcp to change column delimiter

Author  Topic 

bettycalloway
Starting Member

1 Post

Posted - 2014-04-18 : 13:59:15
I have created a stored procedure (FIRST10) that simple selects the top 10 rows from my table.
I execute the stored procedure with the following command:
exec master..xp_cmdshell 'bcp "exec dbo.FIRST10" queryout c:\teletracking\first10patients.csv -U CCCCCC -P XXXXXX -c -t "|" '
This results in the following errors:
SQLState = 28000, NativeError = 18456
Error = [Microsoft][SQL Server Native Client 10.0][SQL Server]Login failed for user 'CCCCCCCC'.
NULL
I have created a link to another server on the current server but I am not trying to connect to the linked server. The error indicates that the execution is trying to go to the other machine.

Any help is greatly appreciated.
Betty Lou

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2014-04-18 : 15:49:06
You need to provide the -S parameter for the server info.

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page
   

- Advertisement -