This month's discount Comprehensive Database Performance Health Check · Testimonials
SQLAuthority with Pinal Dave
Home
  • Consulting
    • Health Check
  • Free Videos
  • All Articles
    • AI
    • SQL Performance
    • SQL Tips and Tricks
    • Interview Questions and Answers
    • SQL Puzzle
    • SQL Video
    • SQLAuthority News
    • Personal
  • Books
  • Consulting
SQL SERVER - Export Data AS CSV from Database Using SQLCMD

SQL SERVER – Export Data AS CSV from Database Using SQLCMD

November 25, 2013
Pinal Dave
SQL Tips and Tricks
CSV, SQL Scripts, SQL Server

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.

Read More
Hands passing a tied bakery box with a window across a doorstep, the layered cake inside still neat.

Sharing Query Results From SSMS: Copy With Headers, Grids and CSV

May 19, 2013
Pinal Dave
SQL Tips and Tricks
CSV, SQL Server, SQL Server Management Studio, sqlcmd

Share SSMS results with copy with headers, text and file output, deliberate CSV quoting, and command-line exports for larger sets.

Read More
Flower frog holding selected stems while an unused stem remains outside the vase

Loading a CSV Whose Columns Do Not Match the Table

April 18, 2013
Pinal Dave
SQL Tips and Tricks
CSV, ETL, SQL Server

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.

Read More
A brass telescope on a harbor balcony aimed at a cargo ship anchored far out in the bay with containers on its deck.

Querying External Files With PolyBase

October 7, 2012
Pinal Dave
SQL Tips and Tricks
Cloud Computing, CSV, File format, SQL Server

PolyBase and SQL Server external tables expose CSV and Parquet files through schemas, while query plans show whether filters reduce remote work.

Read More
A harbor crane lowering a blue shipping container onto a truck trailer, its corners lined up with the locks

Moving Data Out of SQL Server in Open Formats

February 26, 2012
Pinal Dave
SQL Tips and Tricks
CSV, ETL, File format, JSON, SQL Server

Move SQL Server data into open formats such as CSV, JSON, and Parquet while preserving types, NULLs, encoding, and readable files.

Read More
A pasta cutter slicing a sheet of dough into ribbons of equal width, ragged edge trimmings piled aside.

Reading Fixed-Width Text Files With OPENROWSET and a Format File

February 13, 2012
Pinal Dave
SQL Tips and Tricks
CSV, File format, SQL Datatype, SQL Server

Read fixed-width text files with OPENROWSET and an XML format file, trim fields, validate conversions, and load only acceptable rows.

Read More
A hand picking an odd cherry out of a sorting tray

Importing CSV Files Without Surprises

June 19, 2011
Pinal Dave
SQL Tips and Tricks
CSV, ETL, File format, SQL Server

Importing CSV files Without Surprises covers quoted delimiters, UTF-8 encoding, dates, staging tables, and SQL Server BULK INSERT FORMAT = ‘CSV’.

Read More
Previous 1 2 3 4 Next
  • Books
  • Testimonials
  • Privacy Policy

© 2006 – 2026 All rights reserved. pinal @ SQLAuthority.com