title: Tables associated with views, explicitly highlight
body: <p>I need to identify all TABLES associated with a view. The mast view is quite complex and has many sub views, which in turn connected by yet more views. </p>
  
  <p>I found the below code that states the parent child relationship but i need to show explicitly which is a view and which is a table. Could someone help me enhance this?</p>
  
  <p>Do I use type_id or something like where xtype = 'V' , xtype = 'TT</p>
  
  <pre><code> DECLARE @ViewName VARCHAR(MAX);
      SET @ViewName = 'MarketAtAGlance';
  
      select * from 
  
      (
  
  
      WITH deps ( parent, child ) AS ( SELECT v.name ,
                  sed.referenced_entity_name
           FROM   sys.sql_expression_dependencies sed
                  INNER JOIN sys.views AS v ON sed.referencing_id = v.object_id
           WHERE  v.name = ISNULL(@ViewName, v.name)
           UNION ALL
           SELECT v.name ,
                  sed.referenced_entity_name
           FROM   sys.sql_expression_dependencies sed
                  INNER JOIN sys.views AS v ON sed.referencing_id = v.object_id
                  INNER JOIN deps ON deps.child = v.name ) SELECT   parent ,
               child FROM     deps ORDER BY parent ,
               child;
      )
      a
  </code></pre>