I am analyzing a database and there is a view that I don't know where it gets the information from, is there any statement to know where the view gets the data from?
I am analyzing a database and there is a view that I don't know where it gets the information from, is there any statement to know where the view gets the data from?
Enter from SQL Server to the DB you want to look at and in the views section look for the one that interests you. Right-click on it and in the drop-down that appears click Design.
A view editing window will be displayed where the tables used will also appear, as well as the query used to generate that view.
EDIT: In case you want to obtain the query through a query from SQL 2005 you can obtain it in this way: