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 ?