Search code examples
sql-serverssmstxt

Importing .txt file as a table in Microsoft SQL Server Management Studio


I'm trying to upload a text file (.txt) which has over 2 million rows into SQL Server via the Import and Export Wizard.

However I am getting this error, despite the preview looking fine:

Executing (Error)

Messages

Error 0xc02020a1: Data Flow Task 1: Data conversion failed. The data conversion for column "NAME" returned status value 4 and status text "Text was truncated or one or more characters had no match in the target code page.".

Error 0xc020902a: Data Flow Task 1: The "Source - ADDRESS_POINT_txt.Outputs[Flat File Source Output].Columns[NAME]" failed because truncation occurred, and the truncation row disposition on "Source - ADDRESS_POINT_txt.Outputs[Flat File Source Output].Columns[NAME]" specifies failure on truncation. A truncation error occurred on the specified object of the specified component.


Solution

  • I just tried this right now and it looks like this on my system.

    enter image description here