uhlenheuerdotnet
programming, .NET, linux and others

CSV export in T-SQL

by Gregor Uhlenheuer on September 24, 2011

Because I always forget how to export data from the SQLServer into a CSV 1 file I will post it up here:

EXEC master..xp_cmdshell'bcp "SELECT * FROM table" queryout "c:\tmp\export.txt" -c -T -x'

Find more useful tips concerning T-SQL on inpad.de


  1. Comma separated file

This post is tagged with sql, tsql and programming