Search code examples
sql-serverimportssmsflat-file

SQL Data Import From Text Inserts All Fields into Single Column


I have a txt file and the data looks like this

[value]~[value]~[value]~[value]~

When I try to use the SSMS import wizard to import into SQL Server, everything is put into one column and the ~* characters are included in the values (see image) data in single column

I suspect it is a delimiter/encoding problem but I haven't found a way to sort it out.


Solution

  • Define your delimiter. When defining your Flat File Source, on the Columns Pane, enter the delimiter in the "Column delimiter" drop down. For my test file was the =. Then click "Refresh".

    enter image description here