Sanket Verma
Sanket Verma

Reputation: 123

Automation of SQL query

I have recently started working as an Analyst.Part of my job is to run SQL queries on a daily basis and paste the results in an Excel sheet. This sometime becomes tedious. I would like to automate this process i.e. the SQL query should run automatically and the result set(s) should be copied automatically into an Excel sheet(path will be specified by me). Can I do this? If yes, then how?

P.S. We use SQLyog(Open Source) to run SQL queries and Microsoft Excel 2010 to paste and show data.

Upvotes: 1

Views: 186

Answers (2)

ciphor
ciphor

Reputation: 8288

If you want to automate the data publication process, I think a better way is to use 'cron' to schedule you daily query in a shell script, and store the csv data file in a certain directory or send it to your mailbox.

Upvotes: 0

Serjik
Serjik

Reputation: 10931

You could always export your data as comma separated result and open it in Excel. Even if your tools does not support it could be easily created a column that is a concatenation of all your columns comma separated. Then save automatically result as a .csv file to open in Excel.

Upvotes: 1

Related Questions