question

siera_gld avatar image
siera_gld asked

Dynamic Rows and columns

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 DECLARE @statemnt set @statemnt = select t VAL_SQL from T_VALIDATIONS exec (@statemnt ) Here are two examples of VAL_SQL SELECT [EmployeeID] ,[NationalIDNumber] ,[ContactID] ,[LoginID] ,[ManagerID] ,[Title] ,[BirthDate] ,[MaritalStatus] ,[Gender] ,[HireDate] ,[SalariedFlag] ,[VacationHours] ,[SickLeaveHours] ,[CurrentFlag] ,[rowguid] ,[ModifiedDate] FROM [AdventureWorks].[HumanResources].[Employee] for row 2 = SELECT [VendorID] ,[AccountNumber] ,[Name] ,[CreditRating] ,[PreferredVendorStatus] ,[ActiveFlag] ,[PurchasingWebServiceURL] ,[ModifiedDate] FROM [AdventureWorks].[Purchasing].[Vendor] 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)
ssrspivotdynamicrow_number
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers

· Write an Answer

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.