Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

Show Different COLUMNS in Dataset output each time in SSRS Expand / Collapse
Posted Tuesday, March 11, 2014 11:47 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Tuesday, March 25, 2014 5:10 AM
Points: 25, Visits: 56
Currently I have a Report , which gets populated from a dataset.

Now this dataset has a CTE in it. Now the output of the dataset contains SELECT Values from CTE . I want to change the logic in such a way , that when the @@rowcount of the first SELECT CTE is 0 , then it should show me another SELECT QUery . Is that possible.

Because when I write 2 SELECT queries , then the dataset picks up the last query columns .It should instead pickup the columns of that SELECT Query dynamically where the number of rows returned is not ZERO.

How can I acheive this ?
Post #1549887
Posted Tuesday, March 11, 2014 12:29 PM



Group: General Forum Members
Last Login: Monday, November 21, 2016 11:03 AM
Points: 20,009, Visits: 18,255
Combine the queries into a single query (if possible).

You could also create parameters in your report that pass different values to a stored procedure. Based on those parameters, a different set of columns could be returned.

Jason AKA CirqueDeSQLeil
I have given a name to my pain...


Posting Performance Based Questions - Gail Shaw
Post #1549906
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse