Search code examples
sqlsql-servermetadata

Sql Query to list all views in an SQL Server 2005 database


I need an sql query to enumerate all views (I only need the view names) of a specific database in SQL Server 2005.


Solution

  • To finish the set off (with what has already been suggested):

    SELECT * FROM sys.views
    

    This gives extra properties on each view, not available from sys.objects (which contains properties common to all types of object) or INFORMATION_SCHEMA.VIEWS. Though INFORMATION_SCHEMA approach does provide the view definition out-of-the-box.