Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple tables referencing the same dataset

I have a single shared dataset which calls a stored procedure. I have multiple tables which use the same dataset and has filters on the table itself to only include certain records.

Does the dataset get called for each table or does it only get called once?

like image 800
user172839 Avatar asked Oct 24 '25 14:10

user172839


1 Answers

The easiest thing to do is run the report and see what happens in the database. In this example I have used SQL Server Profiler to view the database activity. I have tested using a simple report run through Visual Studio.

Dataset:

enter image description here

Report with two tables, different filters, same Dataset:

enter image description here

enter image description here

enter image description here

Run the report:

enter image description here

Check what has been recorded in SQL Server Profiler:

enter image description here

You can see that the Dataset query has been run only once. So in this case we can say that referencing a Dataset multiple times will not cause it to be loaded multiple times.

With SSRS it's always risky to say this will always be the case in all scenarios, but based on this example it seems like a good bet.

like image 166
Ian Preston Avatar answered Oct 26 '25 14:10

Ian Preston