Bulk Import Large-Object Data by using the OPENROWSET Bulk Rowset Provider (SQL Server)

The SQL Server OPENROWSET Bulk Rowset Provider enables you to bulk import a data file as large-object data.

The large-object data types supported by OPENROWSET Bulk Rowset Provider are varbinary(max) or image, varchar(max) or text, and nvarchar(max) or ntext.

Note

The image, text and ntext data types were deprecated in SQL Server 2005.

The OPENROWSET BULK clause supports three options for importing the contents of a data file as a single-row, single-column rowset. You can specify one of these large-object options instead of using a format file. These options are as follows:

  • SINGLE_BLOB
    Reads the contents of data_file as a single-row, returns the contents as a single-column rowset of type varbinary(max).

  • SINGLE_CLOB
    Reads the contents of the specified data file as characters, returns the contents as a single-row, single-column rowset of type varchar(max), using the collation of the current database; such as a text or Microsoft Word document.

  • SINGLE_NCLOB
    Reads the contents of the specified data file as Unicode, returns the contents as a single-row, single-column rowset of type nvarchar(max), using the collation of the current database.

See Also

Reference

BACKUP (Transact-SQL)

OPENROWSET (Transact-SQL)

bcp Utility

BULK INSERT (Transact-SQL)

Concepts

Import Bulk Data by Using BULK INSERT or OPENROWSET(BULK...) (SQL Server)

Keep Nulls or UseDefault Values During Bulk Import (SQL Server)