March 11, 2014 at 11:47 am
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 ?
March 11, 2014 at 12:29 pm
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, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply