Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Export SQL view to CSV file

Author  Topic 

wsilage
Yak Posting Veteran

82 Posts

Posted - 2015-02-03 : 14:05:32
I have about 700,000 records that I need to export out of a view from SQL into a csv file. How can I do that easily (I am a beginner here).

I know how to export to excel, but not csv.

Thanks.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2015-02-03 : 14:15:12
You can use bcp, SSIS, export wizard, OPENROWSET.

Here's how I do it:

bcp.exe db1.dbo.view1 out c:\temp\view1.csv -c -t, -T -Sserver1\instance1 -r\r\n

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page
   

- Advertisement -