SQL Server Transact Basic to Expert - Query the definition of a view

This blog show how to query the definition of View and see the complete description of the same.

Syntax:

SELECT definition  FROM   sys.sql_modules
WHERE object_id = OBJECT_ID(View Name)


Example:

SELECT definition  FROM   sys.sql_modules
WHERE object_id = OBJECT_ID('vEmptable')
Ebook Download
View all
Learn
View all