err0r 208

  • i executed this querry ......

    EXEC xp_cmdshell 'bcp "SELECT * FROM TB_Category " queryout "C:\bcptest.txt" -T -c -t,'

    i got the following result

    SQLState = 42S02, NativeError = 208

    Error = [Microsoft][SQL Native Client][SQL Server]Invalid object name 'TB_Category'.

    SQLState = 42000, NativeError = 8180

    Error = [Microsoft][SQL Native Client][SQL Server]Statement(s) could not be prepared.

    NULL

    Thanks in advance

  • Try specifying the database name in the query:

    SELECT * FROM <database>.<schema>.<table>

    -- Gianluca Sartori

  • i excuted the query as follow with Database and schema with quey

    EXEC xp_cmdshell 'bcp "SELECT * FROM [DB_SCG] [SHIVA] [TB_Category] " queryout "C:\bcptest.txt" -T -c -t,'

    i got the error as follow

    SQLState = 42000, NativeError = 102

    Error = [Microsoft][SQL Native Client][SQL Server]Incorrect syntax near 'TB_Category'.

    SQLState = 42000, NativeError = 8180

    Error = [Microsoft][SQL Native Client][SQL Server]Statement(s) could not be prepared.

    NULL

  • EXEC xp_cmdshell 'bcp "SELECT * FROM [DB_SCG].[SHIVA].[TB_Category] " queryout "C:\bcptest.txt" -T -c -t,'

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

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

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