Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

BCP Command, Error - Login failed for user Expand / Collapse
Author
Message
Posted Thursday, June 14, 2012 3:42 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, December 30, 2013 7:28 AM
Points: 9, Visits: 48
I am using this BCP command to output the data from a table into the file, and getting this error message:

SQLState = 28000, NativeError = 18456
Error = [Microsoft][SQL Server Native Client 10.0][SQL Server]Login failed for user 'domain\username'.

Here's the command I have:

bcp "SELECT * FROM database.dbo.TableName" queryout \\sharedlocation\Test\File.DAT -S"SERVERNAME" -U"domain\username" -P"password" -o"\\sharedlocation\Test\Log.txt"

I do not want to have -T (trusted connection) rather want to have SQL authentication. Am I missing anything in the command? Please help!!
Post #1316224
Posted Thursday, June 14, 2012 3:57 PM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Yesterday @ 2:31 PM
Points: 893, Visits: 6,882
How is the ID set up in SQL Server? Is it set up to be a windows authenticated id? If so, putting the network name and the password on the command line isn't going to work. You'll either have to use a trusted connection or set up a separate ID with SQL Server Authentication.



And then again, I might be wrong ...
David Webb
Post #1316231
Posted Thursday, June 14, 2012 4:38 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, December 30, 2013 7:28 AM
Points: 9, Visits: 48
Thanks, that worked!
Post #1316237
Posted Thursday, June 14, 2012 4:39 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, August 23, 2012 12:01 PM
Points: 3, Visits: 40
It looks like you are passing a domain\windows_acct to what is supposed to be a sql_login
Post #1316238
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse