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?
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?
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'))