I can’t seem to get all the table names that a view is trying to use.
Currently, I am using INFORMATION_SCHEMA.VIEW_COLUMN_USAGE to find which tables are used. But, it only finds tables that currently exist. I want to find out if that view is trying to use tables that don’t exist.
View_Column_Usage will only find columns that are used in the view. You can check to see if those columns are in any of the current tables columns to find which columns aren’t used, but you can’t find which tables aren’t used.
Does anyone know a table I can use to find which tables are used in a view, but do not exist?
The script I found here seems to work to find the views that are broken.
http://www.sqlservercentral.com/Forums/Topic785213-146-1.aspx#bm785697