BCP Error :(

  • Hi

    I am trying to create a bcp command to export data from a sql server table to text file

    I have created the table and the bcp command I have is:

    bcp exercise.dbo.employees out "C:\1.txt" -S SYS-12345 -U sa -P password -w -r -T -K -q

    but now the command prompt displays the following error

    SQLState = 28000, NativeError =18456

    Error = [Microsoft][SQL Server Native Client 10.0][SQL Server]Login failed for user 'sa'.

    The file names, directories and sql server instance is all correct, I have triple checked.

    Can anyone see what I need to do?

    Sagar Sonawane
    ** Every DBA has his day!!:cool:

  • I hope this is not your real SA password...

    It would not be a wise move posting it on a public forum.

    Some advice:

    1) Don't use sa.

    2) Use Windows Authentication (should be -E for BCP)

    3) Really, don't use sa.

    4) I mean you should not use sa.

    🙂

    -- Gianluca Sartori

  • I have tried it using -E (Windows authentication).... it was giving login errors for my local user.... the user already has sysadmin rights...hence I used the another way...and I am aware that not to put details of my environment... its just test environment so no issues abt it... still for u I made it changed 🙂

    Sagar Sonawane
    ** Every DBA has his day!!:cool:

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply