Skip to content
Advertisement

Bulk load: An unexpected end of file was encountered in the data file

I am using SQL Server Express 2008

When I’m trying load data from txt file in to this table

I use

SQL Server Express trows me errors

Msg 545, Level 16, State 1, Line 2 Explicit value must be specified for identity column in table ‘Clients’ either when IDENTITY_INSERT is set to ON or when a replication user is inserting into a NOT FOR REPLICATION identity column.

File has only one line (for now just sample data) I check it many times its one line

Data looks like this

Any ideas how to fix this problem?

Advertisement

Answer

You need the parameter KEEPIDENTITY in your bulk insert statement. This is required to retain identity values in the load.

I also think you will have a problem because you have no data or placeholder for the Notes column. A comma added to the end of the file should address this.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement