How to list all views in database in MSSQL

To list all views in database in MSSQL you can use the following snippet.

Sample MSSQL

SELECT SCHEMA_NAME(schema_id) AS [schema],name AS [viewname] ,OBJECTPROPERTYEX(OBJECT_ID,'IsIndexed') AS [IsIndexed] ,OBJECTPROPERTYEX(OBJECT_ID,'IsIndexable') AS [IsIndexable], * FROM sys.views;

One thought on “How to list all views in database in MSSQL

Leave a Reply