BCP getting error!!

  •  

    Microsoft Windows [Version 5.2.3790]

    (C) Copyright 1985-2003 Microsoft Corp.

    C:\Documents and Settings\Administrator>cd..

    C:\Documents and Settings>cd..

    C:\>bcp bbc-nortal_d.tnt.empt out c:\shasha\empt.bcp -n -Utnt -Ptnt

    SQLState = 37000, NativeError = 170

    Error = [Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near '-'.

    C:\>bcp bbc-nortal_d.tnt.empt out c:\shasha\empt.bcp -n -Utnt -Ptnt -eC:\shashankt\error.txt

    SQLState = 37000, NativeError = 170

    Error = [Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax

    near '-'.

    i tried but i got this type of error

    tnt is owner name and also password to connect database 'bbc-nortal_d'

    we have sql server 2000 enterprise edition

    please help me out

    T.I.A

    Shashank


    Regards,

    Papillon

  • You just need to use brackets around your database name so bcp doesn't parse the "-" as a parameter.

    bcp [bbc-nortal_d].tnt.empt out c:\shasha\empt.bcp -n -Utnt -Ptnt

    should do it...

    /*****************

    If most people are not willing to see the difficulty, this is mainly because, consciously or unconsciously, they assume that it will be they who will settle these questions for the others, and because they are convinced of their own capacity to do this. -Friedrich August von Hayek

    *****************/

  • Hey!!!

    That worked

    Thanks

    shashank


    Regards,

    Papillon

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

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