Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
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
Author
Message
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


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Today @ 3:27 PM
Points: 21,750, Visits: 15,447
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...
MCM SQL Server


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Posting Data Etiquette - Jeff Moden
Hidden RBAR - Jeff Moden
VLFs and the Tran Log - Kimberly Tripp
Post #1549906
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse