I host a sql statement in a table column/row which is going to be used in a report. When I call this sql statement it is something like this
set @statemnt = select t VAL_SQL from T_VALIDATIONS
exec (@statemnt )
Here are two examples of VAL_SQL
Now i need to put the statement into a set of rows and columns which dynamically get generated at runtime.
Row 1 could contain a statemnt which generates 15 columns
Row 2 could generate a result of 8 columns... all depending on what is in the val_sql
can anyone asist with a row_number or pivot statement to assist? The statement should have 3 attributes - Rows, Columns, Values in order to place in a matrix report (ssrs)