Know with which tables a view was created, SQL Server [closed]

0

I am analyzing a database and there is a view that I do not know where the information comes from, is there a sentence to know where the data is coming from?

    
asked by Jose Yeste 12.05.2017 в 10:15
source

1 answer

0

enter from SQL Server to the BBDD 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 is shown click on Design.

A view editing window will be displayed where the tables used will be displayed as well as the query used to generate that view.

EDIT: In case you want to obtain the query by means of a SQL 2005 query, you can obtain it in this way:

SELECT definition
FROM sys.objects o
JOIN o.object_id = object_id('dbo.Nombre_DE_La_Vista') and o.type = 'V'
    
answered by 12.05.2017 / 10:22
source