Bulk Importing Large-Object Data

A data file can be bulk-imported as large-object data. In Microsoft SQL Server 2005, the image, text and ntext data types are deprecated. The replacement data types are varbinary(max), varchar(max) and nvarchar(max) respectively.

Importing Large Objects by using the OPENROWSET Bulk Rowset Provider

To import large-object data, the OPENROWSET BULK clause supports three options that allow you to import the contents of a data file as a single-row, single-column rowset. You can specify one of the large-object options instead of using a format file.

The large-object options are:

  • 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

Concepts

Keeping Nulls or Using Default Values During Bulk Import

Other Resources

BACKUP (Transact-SQL)
OPENROWSET (Transact-SQL)
bcp Utility
BULK INSERT (Transact-SQL)

Help and Information

Getting SQL Server 2005 Assistance