We often import CSV into SQL Server, but how do you export data as CSV with SQLCMD? Two simple commands, one with column headers and one without.
Sharing Query Results From SSMS: Copy With Headers, Grids and CSV
Share SSMS results with copy with headers, text and file output, deliberate CSV quoting, and command-line exports for larger sets.
Loading a CSV Whose Columns Do Not Match the Table
Your supplier’s CSV has an extra column and a different order. Here is how to load it safely, with a header check and a staging table.
Querying External Files With PolyBase
PolyBase and SQL Server external tables expose CSV and Parquet files through schemas, while query plans show whether filters reduce remote work.
Importing CSV File into SQL Server: SQL in Sixty Seconds #018
Importing CSV file data into SQL Server means matching the file to a table, loading it and checking the result. The tests here show a bad row skipped after a printed error, a text staging load, and the encoding and line ending settings that break a load.
Moving Data Out of SQL Server in Open Formats
Move SQL Server data into open formats such as CSV, JSON, and Parquet while preserving types, NULLs, encoding, and readable files.
Reading Fixed-Width Text Files With OPENROWSET and a Format File
Read fixed-width text files with OPENROWSET and an XML format file, trim fields, validate conversions, and load only acceptable rows.






