List of views created on a table

Tools
Enthusiast

List of views created on a table

Hi

I would like to the list of view names that are created on a particular table.
For example, there are 2 views view1 and view2 that are created on a table Table1.

Is there any query by which i can know that there are 2 views (view1 & view2) that are existing on table1.

Thanks
Madhavi.
2 REPLIES
Enthusiast

Re: List of views created on a table

SELECT TableName
FROM DBC.Tables
WHERE TableType = 'V'
and ExplainText LIKE '% your table name here %'
Group By 1
Order By 1;
--Note sure it is ExplainText or SQLText--Please check accordingly

This will give you your desired results.
Enthusiast

Re: List of views created on a table

Thanks Arun Kumar

This one helped me... :)

For other users... the exact answer would be..

SELECT TableName
FROM DBC.Tables
WHERE Tablekind = 'V'
AND requestText LIKE '%The table name%'
GROUP BY 1
ORDER BY 1;

Thanks
madhavi.