Batch import TXT into SQL Server TEXT / NTEXT / VARCHAR(MAX) / NVARCHAR(MAX)

Want to batch import TXT (Text) documents into SQL Server [TEXT, NTEXT, VARCHAR(MAX), NVARCHAR(MAX)] (CLOB) column?

Try Withdata DBBlobEditor, a SQL Server [TEXT, NTEXT, VARCHAR(MAX), NVARCHAR(MAX)] (CLOB) editor, Bulk import TXT into SQL Server, East and Fast.

Download DBBlobEditor Download DBBlobEditor

Batch import TXT documents to SQL Server [TEXT, NTEXT, VARCHAR(MAX), NVARCHAR(MAX)] (CLOB) column

Run DBBlobEditor, login to SQL Server.

Batch import txt files into SQL Server [TEXT, NTEXT, VARCHAR(MAX), NVARCHAR(MAX)] (CLOB) - login to SQL Server

Click “Start New Task – Import LOB From Files” at task dialog.

Batch import txt files into SQL Server [TEXT, NTEXT, VARCHAR(MAX), NVARCHAR(MAX)] (CLOB)  - Task Window

then show the wizard.

1. Configure import TXT settings.

Batch insert txt files into SQL Server [TEXT, NTEXT, VARCHAR(MAX), NVARCHAR(MAX)] (CLOB) - config

2. Bulk import TXT files to SQL Server [TEXT, NTEXT, VARCHAR(MAX), NVARCHAR(MAX)] (CLOB).

Batch save txt files into SQL Server [TEXT, NTEXT, VARCHAR(MAX), NVARCHAR(MAX)] (CLOB)  - import

then you can see importing results

Batch import txt files into SQL Server [TEXT, NTEXT, VARCHAR(MAX), NVARCHAR(MAX)] (CLOB)  - view


More about SQL Server [TEXT, NTEXT, VARCHAR(MAX), NVARCHAR(MAX)] (CLOB) importer

TXT → SQL Server reference

Type mapping

Value kindin TXTin SQL Server
Int1234, or right-aligned in a fixed-width columnint
Bigint9007199254740993bigint
Decimal1234.56decimal(p,s)
Float1.234e+10float
Textwritten as-is; padding depends on the chosen layoutnvarchar(n)
Long textwritten as-isnvarchar(max)
Datewhatever the writer chosedate
Datetimewhatever the writer chosedatetime2
Binarynot representablevarbinary(max)
BooleanY / N, or 1 / 0, or TRUE / FALSEbit

Dialect differences

TXT is a file format and SQL Server is a database server, so the target has to be told the types the file never carried – the rows below are where the two sides diverge.

Propertyin TXTin SQL Server
port—1433
identifiersNone by convention[square brackets]
row limit—SELECT TOP n
datesWhatever the writer produced; no convention is guaranteeddatetime, datetime2, date, time
long text—nvarchar(max)
binaryNot supportedvarbinary(max)
separatorWhatever was chosen - often fixed column widths—
encodingNo declaration - UTF-8 works only with a BOM—
typingNone - every field is text—
shapeFree form; a parser has to be told the layoutTables of rows and columns
ceilingNo formal limit—

Command line

SideCommand
SQL Serverbcp
SQL Server (load)bcp, or BULK INSERT

Convert your data online, free

Free in-browser converters for CSV, Excel, JSON, XML and SQL: Withdata Online Data Conversion. Large files, batch conversion or scheduling? See the offline desktop apps, or browse all data conversion tools.