BULK INSERT
parses file rows with format options, loads in batches
What changes
- Input
- a data file (local path, UNC, or Azure Blob via external data source)
- Output or change
- rows in a table or view
Syntax at a glance
BULK INSERT { database_name.schema_name.table_or_view_name | schema_name.table_or_view_name | table_or_view_name } FROM 'data_file' [ WITH ( [ [ , ] DATA_SOURCE = 'data_source_name' ]
Work example
A controlled import must load a known file into a reviewed staging table.
Use a non-sensitive fixture in an isolated environment. Confirm file location, encoding, field boundaries, error handling, and minimum required permissions.
Check your work BULK INSERT. The staged row count and rejected-row report match the fixture. The destination is not a production table.
Open Microsoft Learn for full syntax, permissions, and details for your version.