SQL Server: some links on BULK IMPORT format files
Posted by jpluimers on 2013/12/04
From my link archive:
- BULK INSERT (Transact-SQL).
- Schema Syntax for XML Format Files.
- Specify File Storage Type by Using bcp (SQL Server).
- Use a Format File to Map Table Columns to Data-File Fields (SQL Server).
- Non-XML Format Files (SQL Server).
- XML Format Files (SQL Server).
- Create a Format File (SQL Server).
- SQL Server: BULK INSERT from file that contains dates in format YYYYMMDD – Stack Overflow.
- Problems and questions about BULK INSERT in SQL Server 2008.
- A Nofsinger’s Blog: Using BCP Format Files and SQL BULK IMPORT.
Note that for importing decimal/numeric columns, you have two options:
- Cast through FLOAT using a FORMAT file
- Use OpenRowSet with VARCHAR, then CAST afterwards
Weird rounding for decimal while doing a bulk insert from a CSV.
Some more links on this:
- float and real (Transact-SQL).
- SQL Server: BULK INSERT from file that contains dates in format YYYYMMDD – Stack Overflow.
–jeroen
Leave a Reply