Use Excel cell reference (Parameterize) in SQL Query to local SQL server

I want to use 2 columns in excel (A & B) as parameters in an SQL query to an SQL Server. I then want to drag the query down 200 lines to select the required data from the DB.

Pic with Example

I have tried

Get Data > From Microsoft Query - Didn't work. It just doesn't seem to be the right avenue for this (ie: No option for this).

Get Data > From SQL Server Database and it brings up Navigator and I see a preview of the data. I don't want to import all the data though. I want to customize a query and only import that data.

This is not a duplicate of How do I write a query in Microsoft SQL Server Management Studio and then use that Query in Excel since those steps don't work in Excel 2016.

2 Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like