Find out all the views in a database using SQL Server 2005

In order to find out all the views in a database, use this query :

USE AdventureWorks
GO
SELECT [name] AS ViewName
,create_date as CreationDate
,modify_date as ModificationDate
FROM sys.views
ORDER BY ViewName
GO

You can also get various other info like SchemaName from sys.views using the query:

SELECT [name] AS ViewName, SCHEMA_NAME(schema_id) AS SchemaName
FROM sys.views

No comments:

Post a Comment