Is there a way to view a view query with read-only permissions?

0

I need to get the query of a database view sql server and I only have read permissions and having only read permissions, the design field is deactivated.

Is there a way to see the query without the permissions?

    
asked by Jose Yeste 12.09.2017 в 16:25
source

1 answer

1

From SQL server 2005 you can get the Query with which a view was created.

You can get it with this SQL server query> = 2005:

SELECT definition
FROM sys.objects objs
INNER JOIN sys.sql_modules m on m.object_id = objs.object_id
WHERE objs.object_id = object_id( 'dbo.NombreVista') AND objs.type = 'V'

Or with this for SQL server > = 2008

SELECT object_definition (OBJECT_ID(N'dbo.vEmployee'))
    
answered by 12.09.2017 в 16:31