bcp syntax error

  • The following code

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

    gives me the error:

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

    What is wrong with this code?

    Thanks for helping.

  • Try adding the database name to the query: pubs.dbo.authors (or whatever your db name is).

  • Thanks Lynn, It worked.

    Merci Beaucoup

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

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