OPENROWSET(BULK)
reads file contents as rows
What changes
- Input
- file or external data source (CSV, Parquet, single BLOB/CLOB, format file)
- Output or change
- rowset, or one LOB value with SINGLE_BLOB/CLOB/NCLOB
Syntax at a glance
OPENROWSET( BULK 'data_file_path', <bulk_option> ( , <bulk_option> )* ) [ WITH ( ( <column_name> <sql_datatype> [ '<column_path>' | <column_ordinal> ] )+ ) ]
Work example
A one-time lab import needs rows from a known fixture file.
Use a synthetic local file and a restricted test instance. Check provider settings, path access, encoding, and file permissions.
Check your work OPENROWSET(BULK). The loaded row count and column boundaries match the fixture without accessing a production path.
Open Microsoft Learn for full syntax, permissions, and details for your version.