BCP Invalid Object Name Error

  • I am trying to export results from a temporary table to a .csv file and recieve the following error -

    SQLState = S0002, NativeError = 208

    Error = [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name '#TOWNNEWS'.

    Here is my bcp command line -

    EXEC master.dbo.xp_cmdshell 'bcp #TOWNNEWS out C:\Subscribers.csv -c -S **** -U sa -P *******'

    Can someone please help me out?

  • #townnews won't exist from the BCP session. It will only exist in the session that created it.

  • Thank you for the help. I created a permanent table and everything executed the way it should.

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

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