Solved

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

Posted on 2011-02-17
3
618 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Creating and Managing Databases with phpMyAdmin in cPanel.
By, Vadim Tkachenko. In this article we’ll look at ClickHouse on its one year anniversary.
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…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

632 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