Unsupported Screen Size: The viewport size is too small for the theme to render properly.

Automation Of Sql Query

Tagged: ,

  • This topic is empty.
Viewing 3 reply threads
  • Author
    Posts
    • #13251
      Sanket Verma
      Member

      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.

    • #35020
      peterlaursen
      Participant

      The is an “SQL Scheduler and Reporting Tool” (in the ‘powertools’ menu), but it will deliver query results as HTML-formatted mail. With the same tool you may schedule a SELECT INTO OUTFILE -query generating a CSV file.  But note that  SELECT INTO OUTFILE in MySQL has no LOCAL option so the file will be saved on the server machine. Refer MySQL documentaton http://dev.mysql.com/doc/refman/5.5/en/select-into.html.

       

      We have a request already for client-side generation fof CSV (and other file formats) from this tool in our issuetracker at https://code.google.com/p/sqlyog/issues/detail?id=1696.  But it is currently not possible and it is also not planned for near future.

    • #35021
      Stacy Martin
      Member

      I, too, wish sqlyog had this functionality.

    • #35022
      zenggggg
      Member

      you can do it by excel macro VBA, and schedule time in windows task scheduler. your sql code will be inside your vba code. once macro run, sql runs and auto populate the data on excel. 

Viewing 3 reply threads
  • You must be logged in to reply to this topic.