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:
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.
I have column headers in the file I am trying to import. But wizard is not detecting this -
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.