SQL Server administration and T-SQL development, Web Programming with ASP.NET, HTML5 and Javascript, Windows Phone 8 app development, SAP Smartforms and ABAP Programming, Windows 7, Visual Studio and MS Office software

Development Forums for Programmer, Administrators and Users

Development resources, articles, tutorials, samples, codes and tools for .Net, SQL Server, Windows, Windows Phone, SAP and ABAP, like SAP UI5, Screen Personas, etc.

BCP Command Error = [Microsoft][SQL Server Native Client 10.0][SQL Server]Invalid object name

Last post 02-03-2011, 2:13 PM by eralper. 1 replies.
Sort Posts:
  •  02-03-2011, 2:05 PM 22317

    BCP Command Error = [Microsoft][SQL Server Native Client 10.0][SQL Server]Invalid object name

    Hello all,
    I was trying to do hands-on learning by executing the SQL Server BCP command from the sql tutorial.


    DECLARE @cmd varchar(1000)
    SET @cmd = 'bcp "SELECT FirstName, LastName FROM AdventureWorks2008R2.Person.Person" queryout "c:\textfile.txt" -c -UTF8 -T -Slocalhost'
    EXEC master..xp_cmdshell @cmd


    But I got the following error message :


    SQLState = S0002, NativeError = 208
    Error = [Microsoft][SQL Server Native Client 10.0][SQL Server]Invalid object name 'AdventureWorks2008R2.Person.Person'.
    SQLState = 37000, NativeError = 8180
    Error = [Microsoft][SQL Server Native Client 10.0][SQL Server]Statement(s) could not be prepared.


    I'm trying to find out where I'm making a mistake.
    I checked the database name first if the sample databases are different on the two different SQL Server installations.

  •  02-03-2011, 2:13 PM 22318 in reply to 22317

    BCP Command Error = [Microsoft][SQL Server Native Client 10.0][SQL Server]Invalid object name

    I found where I was mistaken.
    I used the -Slocalhost unchanged.
    But my SQL Server 2011 Denali installation is on a SQL Server named instance.

    When I changed the -Slocalhost to -SKodyaz\Denali which is the SQLServerName\SQLInstanceName the SQL Server BCP command works successfully

View as RSS news feed in XML
Copyright © 2004 - 2017 Eralper YILMAZ. All rights reserved.
Community Server by Telligent Systems