Not inserted into tables while using BCP IN command

Ramana Kopparapu 306 Reputation points
2023-02-22T04:32:23.3733333+00:00

I am getting below error when i am trying to push the data from Flat File source to Sql Server table...

C:\Users\Admin>BCP Sample.[dbo].[Player] IN D:\Files\Player.txt -T -c

Starting copy...

SQLState = S1000, NativeError = 0

Error = [Microsoft][ODBC Driver 17 for SQL Server]Unexpected EOF encountered in BCP data-file

0 rows copied.

Network packet size (bytes): 4096

Clock Time (ms.) Total : 1

SQL Server Other
{count} votes

Accepted answer
  1. Seeya Xi-MSFT 16,586 Reputation points
    2023-02-22T07:28:54.08+00:00

    Hi @Ramana Kopparapu ,

    There are a few possible reasons why this error can occur:

    • The data file may be corrupt or incomplete. Check the file to ensure that it is properly formatted and contains all the required data.
    • There may be formatting issues with the data in the file. Check that the data is formatted correctly and matches the expected format for the destination table.

    If you have checked and still have problems, you can put the sample here.

    Best regards,

    Seeya


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Olaf Helper 47,436 Reputation points
    2023-02-22T06:31:09.13+00:00

    Unexpected EOF encountered in BCP data-file

    "Unexpected EOF = End Of File"

    Then the source files format don't matches the expected on. Use a format file to define the format for the source file.

    See bcp Utility

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.