• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Data from SQL with server-side filters

neFAST

New Member
Dear all,
I'm trying to use Excel to extract data from a MSSQL server and then filter rows that contain specific values in some columns.
This is very basic and easy, even for a total newbie like me!

But now I'm querying a database with 100k+ rows and I only need to select a few dozen of rows. Dumping those 100k rows in excel and then filtering 99% away does not seem a smart and efficient way to do that.
  • So I was wondering if there's a better way to achieve this, I was thinking excel could build a SELECT query with parameters taken from specific cells.
  • I was also wondering if PowerPivot can help.
  • any other option is welcome!
 
neFast

Firstly, Welcome to the Chandoo.org Forums

If you only want a few dozen rows from 100k+ rows, then Excel uis ideal tool for this. Power Pivot etc is an overkill.

You can access the SQL DB directly and include a selection string as part of the process

Open Excel
Goto the Data, From Other Sources, From SQL Server tab
Complete the form and subsequent dialogs

upload_2015-3-6_10-17-15.png
 
Thanks for your answer
If you only want a few dozen rows from 100k+ rows, then Excel uis ideal tool for this. Power Pivot etc is an overkill.
Keep in mind I want only a dew dozen rows but not always the same ones.
The SELECT filters have to be dynamic.
You can access the SQL DB directly and include a selection string as part of the process

Open Excel
Goto the Data, From Other Sources, From SQL Server tab
Complete the form and subsequent dialogs
This is what I'm doing except that I did not customized the SQL query. Can I make the selection depends on the content of specific excel cells?
 
Back
Top