Solved

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

Posted on 2011-02-17
3
613 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

All XML, All the Time; More Fun MySQL Tidbits – Dynamically Generate XML via Stored Procedure in MySQL Extensible Markup Language (XML) and database systems, a marriage we are seeing more and more of.  So the topics of parsing and manipulating XM…
Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
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…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

867 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now