Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2011-02-17
3
Medium Priority
?
620 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 750 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

Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

Question has a verified solution.

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

Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

721 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