Wednesday 5 November 2014

SQL Queries Within Excel Using ADO

Recently I've taken some minor steps into the wide world of databases to give Excel a helping hand. I'll be honest and say I'm very much a beginner so don't expect much. I'm still learning the ins and outs of basic SQL.

Anyway, here's a little something I made on the weekend that allows you to perform simple queries within Excel itself. And it also allows to save your SQL queries so you can use them again later. (Forget indenting, go online or try your luck waiting for a later version!)



Assuming your data is in tables, you can select columns from sheets in your workbook, to insert the sheet (table) name and column (field) name directly into your SQL.

To be honest, it's half useful (for me at least, I can use it at work), and half experimental (as I'm still taking baby steps, I'm seeing what I can actually do with it).

Here's the download link.

See you next time. (I may or may not be be busy making Japanese versions of my add-ins for a week or two)

5 comments :

  1. Hello Andy, your link is broken - just replace the text Excel and Ecxel. Thanks for sharing this tool.
    Jiri Cihar, dataspectrum - http://www.dataspectrum.cz

    ReplyDelete
    Replies
    1. Jiri, Thanks for noticing. Link fixed ;-)

      Delete
  2. For a client, I did ADO queries to SQL Server straight from Excel. No muss, no fuss, and very fast.

    ReplyDelete
    Replies
    1. Bruce, it is handy, isn't it?. In this case, I wanted something to work on Excel data received occasionally that otherwise needs extensive work to become usable. Not worth the hassle of exporting to and re-importing from a proper database. But I'll be looking at more long term stuff later, even if just for study.

      Delete
  3. Thanks a lot for sharing this. I was looking for this ado

    ReplyDelete