Rashmi Shivanna
Rashmi Shivanna

Reputation: 85

"Import Flat File" wizard unable to detect the column headers

I am using "Import Flat File" wizard in the SQL Server 2017 to import a .txt file into the database. Below screenshot shows the steps:

enter image description here

Once I select the file location, I see the data preview. In data preview, I don't see the column names. Wizard has ignored the column names which are present in the file and assigned column1, column2, etc as column names.

enter image description here

I have column headers in the file I am trying to import. But wizard is not detecting this -

enter image description here

This issue is happening with only 2 files. I imported 2 other files and wizard was able to detect the column headers in those files.

I tried converting .txt file into .csv file. In this case, wizard treats the column headers as one of the rows and assigns column1, column2, etc as column names.

Please let me know if there is a way to force the "Import Flat File" wizard to treat first row as column headers.

Upvotes: 3

Views: 9520

Answers (2)

user2934764
user2934764

Reputation: 11

If one of the headers in the import file exceeds the 128 character limit for column names, the import will not identify any of the column names.

Upvotes: 1

The column headers will be missing if the number of delimiters in the header does not match the number of delimiters in the data

Upvotes: 4

Related Questions