Solved

Export data from SQL Server table to a CSV file and schedule it

Posted on 2011-02-17
3
614 Views
Last Modified: 2012-06-21
I need to export data from a SQL Server table into a csv file and put it on the network drive. I need to run this on a scheduler every day. Any help is greately appreciated.
0
Comment
Question by:Rdichpally
  • 2
3 Comments
 
LVL 5

Accepted Solution

by:
jason987 earned 250 total points
ID: 34918911
sqlcmd -S YourServer -d YourDB -E -Q "select col1, col2, col3 from yourTable" -o "yourfilepathandnameonnetworkdrive.csv" -h-1 -s"," -w 700
0
 
LVL 5

Expert Comment

by:jason987
ID: 34918924
For a description of the switches involved:

http://msdn.microsoft.com/en-us/library/ms162773.aspx
0
 

Author Closing Comment

by:Rdichpally
ID: 35029506
Thanks.
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have been using r1soft Continuous Data Protection (http://www.r1soft.com/linux-cdp/) for many years now with the mySQL Addon and wanted to share a trick I have used several times. For those of us that don't have the luxury of using all transact…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question