Home Forums SQL Server 2008 SQL Server 2008 - General BCP In error while trying to load server details from txt flat file to sql table RE: BCP In error while trying to load server details from txt flat file to sql table

  • SQL-DBA-01 (3/4/2015)


    declare @sql nvarchar(4000)

    select @sql = 'bcp [DBNAME].[dbo].[servertable] in C:\folder\serverlist.txt -SLaptop-01 -T -E -n '

    exec master..xp_cmdshell @sql

    Getting the below error: Please suggest.

    NULL

    Starting copy...

    SQLState = S1000, NativeError = 0

    Error = [Microsoft][SQL Server Native Client 11.0]Unexpected EOF encountered in BCP data-file

    NULL

    0 rows copied.

    Network packet size (bytes): 4096

    Clock Time (ms.) Total : 1

    NULL

    What is the format of the source file?

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)