Returns one row for views that can be accessed by the current user in the current database.
To retrieve information from these views, specify the fully qualified name of INFORMATION_SCHEMA.view_name.
TABLE_CATALOG
nvarchar(128)
View qualifier.
TABLE_SCHEMA
Name of schema that contains the view.
TABLE_NAME
View name.
VIEW_DEFINITION
nvarchar(4000)
Returns the first 4000 characters of the definition text of the view if the view is not encrypted. Otherwise, returns NULL.
To ensure that you obtain the complete definition, query the OBJECT_DEFINITION function or the definition column in the sys.sql_modules catalog view.
CHECK_OPTION
varchar(7)
Type of WITH CHECK OPTION. Is CASCADE if the original view was created by using the WITH CHECK OPTION. Otherwise, NONE is returned.
IS_UPDATABLE
varchar(2)
Specifies whether the view is updatable. Always returns NO.
The following example returns each view name and the first 4000 characters of the view definition.
4000
USE AdventureWorks; GO SELECT TABLE_SCHEMA, TABLE_NAME, VIEW_DEFINITION AS [First 4000 characters] FROM INFORMATION_SCHEMA.VIEWS;