[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 630
  • Last Modified:

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

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
Rdichpally
Asked:
Rdichpally
  • 2
1 Solution
 
jason987Commented:
sqlcmd -S YourServer -d YourDB -E -Q "select col1, col2, col3 from yourTable" -o "yourfilepathandnameonnetworkdrive.csv" -h-1 -s"," -w 700
0
 
jason987Commented:
For a description of the switches involved:

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

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now