Problem with BCP

  • Hi,

    I am having trouble with BCP.I am using following syntax for inserting rows from text file to one of the table  say Yin x data base with filed terminator $ and row terminator tab.

    bcp X.dbo.Y" in c:\temp\test.txt -c

    -q -t "$" -r "" -T -S [servername\instancename] -U test -p test

    I am getting following error

    SQLState = 08001, NativeError = 17

    Error = [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist o

    r access denied.

    SQLState = 01000, NativeError = 2

    Warning = [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionOpen (Connect()

    ).

    could you please anybody let me know what is the problem here.Is I don't have acess to the server.Any help is appreciated.

    Thanks,

    Sree

     

     

     

    Thanks,
    SR

  • Try a capital -P for the password argument.


    And then again, I might be wrong ...
    David Webb

  • Thanks for your response david.

    I typed capital but that doen't make any difference.

    getting same error.

    Thanks,

    Sree

     

    Thanks,
    SR

  • Hi,

    try this with no use name and password.

    bcp X.dbo.Y" in c:\temp\test.txt -c

    -q -t "$" -r -"" -T -S [servername\instancename] -U -P

    this may help u

    from

    killer

     

  • You either use trusted connection -T or SQL server login (-U and -P). So try either

    bcp X.dbo.Y in c:\temp\test.txt -c -q -t "$" -r "" -T -S [servername\instancename]

    or

    bcp X.dbo.Y in c:\temp\test.txt -c -q -t "$" -r "" -S [servername\instancename] -U"test" -P"test"

    For trusted connection, make sure the windows account you are using can access the SQL server.

     

     

  • Try removing the square brackets [] from the server/instance, these have a different meaning/usage in a DOS command shell than what SQL Server uses them for.

    RegardsRudy KomacsarSenior Database Administrator"Ave Caesar! - Morituri te salutamus."

Viewing 6 posts - 1 through 5 (of 5 total)

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