Last post Sep 10, 2012 05:23 PM by limno
Sep 08, 2012 01:28 AM|neellotus|LINK
I have a view with 7 to 9 tables and it is running slow so i need a query to list all the table names used in a view.
Can anyone help me?
Sep 10, 2012 03:50 AM|Decker Dong - MSFT|LINK
Need a SQL query to list the table names used in a view.
Please just create a View and do this：
Create View MyView
Select [name] from sysobjects where type='U'
Sep 10, 2012 07:40 AM|neellotus|LINK
Thanx for your reply,
It is showing only user-defined tables.
But i want to display tables name against view name. Like i have created view MyViews from two tables (Table_1, Table_2).
Now i want a query that dispaly view information in following manner.
View Name Table Name
MyViews Table_1,Table_2 etc
Sep 10, 2012 05:23 PM|limno|LINK
Try this query:
WHERE View_Name = 'yourViewName'