SQL Server MDS : How to Know Actual MDS Table name for Model Entity and Column name for the Attribute

How to Know Actual MDS Table name for Model Entity and Column name for the Attribute .


here is the Script 


USE MDS

------------------------------------------------------------
-- TODO: Define Model name, Entity name, and Attribute Name
       DECLARE @Model NVARCHAR(50)       = '<<GiveModelName>>';
       DECLARE @Entity_Name NVARCHAR(50) = '<<GiveEntityName>>';
       DECLARE @Attribute_Name NVARCHAR(50)= '<<GiveAttributeName>>';
------------------------------------------------------------

-- Set @Table name
       DECLARE @Table NVARCHAR(128);    
       SELECT @Table = EntityTable FROM mdm.viw_SYSTEM_SCHEMA_ENTITY WHERE Model_Name= @Model AND name= @Entity_Name ;

-- Set @Column name       
       DECLARE @Column NVARCHAR(128)

       SELECT  @Column  = Attribute_Column FROM mdm.viw_SYSTEM_SCHEMA_ATTRIBUTES WHERE Model_Name = @Model AND Entity_Name= @Entity_Name AND Attribute_Name = @Attribute_Name;


SELECT @Table as EntityTableInMDS , @Column as ColumnNameofAttribute

Comments

Popular posts from this blog

SSIS :Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done

SSIS Error : Object is not an ADODB.RecordSet or an ADODB.Record + Solution

SSRS : [Teradata Database] 3939 There is a mismatch between the number of parameters specified and the number of parameters required.