Command to export database to csv or excel file

Category: sql server express

Question

sju2402 on Thu, 14 Dec 2017 15:57:37


I'm not sure this question makes sense or not.

I need a command to export database to csv or excel file and find out what is in that database such as date, time, and soon.


Replies

Khanna Gaurav on Thu, 14 Dec 2017 16:28:31


You can use sqlcmd command which  you can run from command prompt. Refer following link for details. 

https://blog.sqlauthority.com/2013/11/25/sql-server-export-data-as-csv-from-database-using-sqlcmd/

Following link has other options to export from sql server

http://www.sqlservercentral.com/articles/Export/147145/