Hi guys,
I'm currently using radgrid to show users these columns: tableName, dataSources, and dataTypes. And in the SQL database one unique dataName is attached to several dataSources/dataTypes. Currently what I can show in the table is 1 tableName and show the first dataSource attach to it in the SQL, and currently I need to show all the sources and types in a column (i.e. tableName: A, dataSource: B,C,D, dataType: E,F,G). Furthermore can I still use the sorting and filtering function for these columns?
Currently I'm using the code below (stored procedure in SQL) to obtain the dataSources by tableName. This will return dataSource1, dataSource2, and so on that is attached to the tableName. However I'm at lost on how to attach these dataSources in the column in radGrid. I searched around and I'm still not sure how to do it.
Thank you so much :)
I'm currently using radgrid to show users these columns: tableName, dataSources, and dataTypes. And in the SQL database one unique dataName is attached to several dataSources/dataTypes. Currently what I can show in the table is 1 tableName and show the first dataSource attach to it in the SQL, and currently I need to show all the sources and types in a column (i.e. tableName: A, dataSource: B,C,D, dataType: E,F,G). Furthermore can I still use the sorting and filtering function for these columns?
Currently I'm using the code below (stored procedure in SQL) to obtain the dataSources by tableName. This will return dataSource1, dataSource2, and so on that is attached to the tableName. However I'm at lost on how to attach these dataSources in the column in radGrid. I searched around and I'm still not sure how to do it.
USE [table]GOSET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGO-- =============================================-- Author: <Author,,Name>-- Create date: <Create Date,,>-- Description: <Description,,>-- =============================================ALTER PROCEDURE [dbo].[getDataSources_byTableName] -- Add the parameters for the stored procedure here @tableName varchar(20)ASBEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON;select TableAttributeName,MetadataTableAttributes.TableAttributeId,MetadataTableAttributeValues.TableAttributeValueId,MetadataTableAttributeValues.TableAttributeValueinto #tmp2from MetadataTableAttributeValuesinner join MetadataTableAttributes on MetadataTableAttributes.TableAttributeId = MetadataTableAttributeValues.TableAttributeIdselect distinct MetadataTables.TableName,#tmp2.*into #rpt2from MetadataTables inner join MetadataTableAttributeValueson MetadataTables.TableId = MetadataTableAttributeValues.TableIdinner join #tmp2 on MetadataTableAttributeValues.TableAttributeValueId = #tmp2.TableAttributeValueIdIF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[caisis_tmp]') AND type in (N'U'))DROP TABLE [dbo].[caisis_tmp]CREATE TABLE [dbo].[caisis_tmp](ptMRN [nvarchar](255),dataSource1 [nvarchar](255),dataSource2 [nvarchar](255),dataSource3 [nvarchar](255),dataSource4 [nvarchar](255),)ON [PRIMARY]INSERT INTO [caisis_tmp] (ptMRN)select distinct TableName from #rpt2update [caisis_tmp] set [caisis_tmp].dataSource1= (SELECT TOP 1 #rpt2.TableAttributeValue from #rpt2 where [caisis_tmp].ptMRN = #rpt2.TableName);update [caisis_tmp] set [caisis_tmp].dataSource2= (SELECT TABLEAttributeValue from (SELECT ROW_NUMBER() OVER (ORDER BY TableAttributeValueID) AS RowNum, * FROM #rpt2 where #rpt2.TableAttributeName='dataSource' and [caisis_tmp].ptMRN = #rpt2.tableName) subWHERE RowNum = 2)update [caisis_tmp] set [caisis_tmp].dataSource3= (SELECT TABLEAttributeValue from(SELECT ROW_NUMBER() OVER (ORDER BY TableAttributeValueID) AS RowNum, * FROM #rpt2 where #rpt2.TableAttributeName='dataSource' and [caisis_tmp].ptMRN = #rpt2.tableName) subWHERE RowNum = 3)update [caisis_tmp] set [caisis_tmp].dataSource4= (SELECT TABLEAttributeValue from(SELECT ROW_NUMBER() OVER (ORDER BY TableAttributeValueID) AS RowNum, * FROM #rpt2 where #rpt2.TableAttributeName='dataSource' and [caisis_tmp].ptMRN = #rpt2.tableName) subWHERE RowNum = 4)select * from [caisis_tmp]where ptMRN = @tableNamedrop table [caisis_tmp],#tmp2,#rpt2ENDThank you so much :)
