Anup Shah
Anup Shah

Reputation: 176

SSRS Executes dataset at the end

SSRS has lots of Dataset and order is like below

Dataset1
Dataset2
Dataset3     
Dataset4 -- This deletes some data from above Dataset Tables
NewDataset1
NewDataset2

I have added new Dataset after Dataset4. Dataset4 calls a DELETE Procedure and it works well before added NewDatasets.

Now, I think it executes on order it shows in SSRS is that right? If that so, than what will the solution to run DataSet4 always at last (after NewDataset1 and NewDataset2) without removing that Dataset.

Upvotes: 1

Views: 1198

Answers (2)

Jonnus
Jonnus

Reputation: 3038

According to this MSDN blog post

By default, datasets are executed in parallel

As also mentioned in the arctile it also highlights instances when this is not the desired behaviour such as when

You are executing queries with side-effects (e.g. update statements) and need a particular sequence of dataset executions

Which sounds like what is happening above (if DataSet4) is performing deletes on data.

Finally as mentioned in the article to force the dataset executions to execute in a particular order one after another (Serializsation)

open the data source dialog in report designer, and select the "Use Single Transaction" checkbox

enter image description here

To alter the order of your datasets (if required) open View the Code (Right click report name -> View Code), and physically alter the XML to cut and paste the datasets into the correct order

Upvotes: 4

alejandro zuleta
alejandro zuleta

Reputation: 14108

For execute the dataset in a sequence You can serialize datasets execution go to datasource dialog in report designer and select Use Single Transaction checkbox.

Once selected, datasets that use the same data source are no longer executed in parallel. They are also executed as a transaction, i.e. if any of the queries fails to execute, the entire transaction is rolled back.

The order of the dataset execution sequence is determined by the top-down order of the dataset appearance in the RDL file, which also corresponds to the order shown in report designer.

Be sure to create your datasets in a sequential order as needed, leaving dataset4 at last.

Also check this

Upvotes: 1

Related Questions