This article will help users to embed SQL Query in Excel 2010 and create a dynamic connection in Excel.

Steps

  1. 1
    Go to Data tab and select From Other Sources as shown in the screen shot below.
  2. 2
    Select “From Data Connection Wizard” in the drop down.
    Advertisement
  3. 3
    Data Connection Wizard will open. Select “ODBC DSN” from the available option and click “Next”.
  4. 4
    Connect to ODBC Data Source window appears. Where a list of database available in our organization will be displayed. Select the appropriate database and click on “Next”.
  5. 5
    Select Database and Table window appears.
  6. 6
    We can select the database and the table from where we wish to pull the data. So, select the database and table as appropriate in our case.
  7. 7
    Select Finish in “Save Data Connection File and Finish” window. This window will pull up the File Name based on our selection in previous screens.
  8. 8
    Import Data window appears where we can select options as per our need and click OK.
  9. 9
    Select “From Data Connection Wizard” in the drop down.
  10. 10
    Go to Data tab and Click on Connections. Click on Properties in the following window.
  11. 11
    Go to Definitions tab in the following window.
  12. 12
    Write SQL query in “Command Text” and Click OK. Excel will display the result as per the query.
  13. 13
    Now go to Microsoft Excel and validate if the results are as per the SQL Query written.
  14. Advertisement

About This Article

wikiHow is a “wiki,” similar to Wikipedia, which means that many of our articles are co-written by multiple authors. To create this article, volunteer authors worked to edit and improve it over time. This article has been viewed 376,658 times.
How helpful is this?
Co-authors: 5
Updated: January 8, 2016
Views: 376,658
Categories: Microsoft Excel
Advertisement