user1838149
user1838149

Reputation:

SQL View Attributes

There is a view that has been created in the database, referencing columns of other tables in the same database. How I can find the sources of columns within the view?

For example, Info_View has 4 columns: Name,Surname, Job and Hobby. These columns bind from different tables. How can I know which column comes from where?

Upvotes: 0

Views: 3462

Answers (2)

armen
armen

Reputation: 1283

SELECT view_name, Table_Name
FROM INFORMATION_SCHEMA.VIEW_TABLE_USAGE
WHERE View_Name = '<giveViewName>'
ORDER BY view_name, table_name

got it from here

Upvotes: 1

Related Questions