With this error:

Error inserting data into table. (Microsoft.SqlServer.Import.Wizard)
Error inserting data into table. (Microsoft.SqlServer.Prose.Import)
Object reference not set to an instance of an object. (Microsoft.SqlServer.Prose.Import)

In my case this was due to extra carriage returns at the end of the CSV file – SSMS doesn’t like them! Remove them in a text editor and try again.

Other reasons CSVs fail in this process is nvarchar not set long enough (try MAX), null values (check the allow nulls box for that field), date formats incorrect (there are a few options)

Last modified: April 7, 2021

Author

Comments

Write a Reply or Comment

Your email address will not be published.