Data formats for bulk import or bulk export (SQL Server)
Applies to: SQL Server (all supported versions) Azure SQL Database Azure SQL Managed Instance Azure Synapse Analytics Analytics Platform System (PDW)
SQL Server can accept data in character data format or native binary data format. Use character format when you move data between SQL Server and another application (such as Microsoft Excel) or another database server (such as Oracle or SQL Server). You can use native format only when you transfer data between instances of SQL Server.
In this Topic:
Data Formats for Bulk Import or Export
The following table indicates what data format is generally appropriate to use depending on how the data is represented and the source or target of the operation.
|Operation||Native||Unicode native||Character||Unicode character|
|Bulk transfers of data between multiple instances of SQL Server by using a data file that does not contain any extended or double-byte character set (DBCS) characters. Unless a format file is used, these tables must be identically defined.||Yes*||-||-||-|
|For sql_variant columns, use of native data format is best, because native data format preserves the metadata for each sql_variant value, unlike character or Unicode formats.||Yes||-||-||-|
|Bulk transfers of data between multiple instances of SQL Server by using a data file that contains extended or DBCS characters.||-||Yes||-||-|
|Bulk import of data from a text file that is generated by another program.||-||-||Yes||-|
|Bulk export of data to a text file that is to be used in another program.||-||-||Yes||-|
|Bulk transfers of data between multiple instances of SQL Server by using a data file that contains Unicode data and does not contain any extended or DBCS characters.||-||-||-||Yes|
* Fastest method for the bulk export of data from SQL Server when using bcp.