Sample Header Ad - 728x90

Which is more efficient, filtering the SSRS dataset or filter using a query parameter

3 votes
1 answer
5833 views
People at my organization use SQL Queries within SSRS reports: for instance SELECT name, age FROM egTable Then, this query is run on the database and then they use a FILTER within SSRS to get rid of unwanted rows. For instance, there is a filter in the SSRS called AGE, and this will be something like Age = 11 My proposition was that, this is bad: this way of doing things means that we are querying the ENTIRE table, and then from the GIANT resultset we are just getting rid of unwanted rows. Instead, we should be introducing a parameter: @age, and then write the query as follows: SELECT name, age FROM egTable WHERE age = @age Am I correct in saying that the first method pulls the entire table, whereas mine is far more efficient because it only returns a small result set? How can I verify/prove this?
Asked by LearnByReading (711 rep)
Mar 31, 2015, 05:00 PM
Last activity: Dec 15, 2017, 09:17 AM