Hello all,
I have a requirement to export entire SQL server database with a number of tables to an excel file and all the table data need to be exported as different sheets of an excel. So please help me in this.
Thanks in Advance
Ganesh Kandi.
Batch script to export sql server database to excel
Moderator: DosItHelp
-
- Posts: 1
- Joined: 05 Apr 2018 05:24
Re: Batch script to export sql server database to excel
This really has nothing to do with Batch files other than I would assume you could execute your sql query from the batch file itself. I don't know how many SQL experts we have here but I don't know how we are supposed to help you because you have not provided any technical information to your problem.
Re: Batch script to export sql server database to excel
What you would need to do would be leverage SQLCMD or SQLPLUS from batch to export your tables to a csv file. Then from there, leverage a VB Script (called from batch [CSCRIPT]) to copy that content from the csv file to the specified sheet in your excel workbook.
Very easy to do. Take a crack at it and post your results and then we can step in and assist.
Thanks.
Very easy to do. Take a crack at it and post your results and then we can step in and assist.
Thanks.