sql-serverbulkinsertrowversion

Rowversion field causes BULK INSERT to only import every other row


When I perform a BULK INSERT into a table with a rowversion field, only every other row gets imported.

Here's my source text file:

enter image description here

If I perform a BULK INSERT into a table with a rowversion field, only two rows are imported:

enter image description here

However, if I do the exact same thing but comment out the rowversion field, all four rows are imported:

enter image description here

Is this a bug in SQL Server? Am I doing something wrong? Is there a way to BULK INSERT into tables with rowversion columns?


Solution

  • I found one workaround, but it will require creating and dropping a view to do the bulk insert. It's not a huge deal in my case, since I'm automating the whole process anyway, but I'd still like to know if there is some way to better deal with this without having to create a temporary database object to do it.

    enter image description here