Errors in SQL Server while importing CSV file despite varchar(MAX) being used for each column

后端 未结 6 962
心在旅途
心在旅途 2020-12-02 07:35

I\'m trying to insert a large CSV file (several gigs) into SQL Server, but once I go through the Import Wizard and finally try to import the file I

6条回答
  •  感情败类
    2020-12-02 07:57

    This answer may not apply universally, but it fixed the occurrence of this error I was encountering when importing a small text file. The flat file provider was importing based on fixed 50-character text columns in the source, which was incorrect. No amount of remapping the destination columns affected the issue.

    To solve the issue, in the "Choose a Data Source" for the flat-file provider, after selecting the file, a "Suggest Types.." button appears beneath the input column list. After hitting this button, even if no changes were made to the enusing dialog, the Flat File provider then re-queried the source .csv file and then correctly determined the lengths of the fields in the source file.

    Once this was done, the import proceeded with no further issues.

提交回复
热议问题