List views in Azure SQL database with their scripts

Query below lists views in a database with their definition.


select schema_name(v.schema_id) as schema_name, as view_name,
       v.create_date as created,
       v.modify_date as last_modified,
from sys.views v
join sys.sql_modules m 
     on m.object_id = v.object_id
 order by schema_name,


  • schema_name - view schema name
  • view_name - view name
  • created - date and time was created
  • last_modified - view last modification date and time
  • definition - view definition script including 'create view' statement


  • One row represents one view
  • Scope of rows: all views in database
  • Ordered by schema name, view name

Sample results

Comments are only visible when the visitor has consented to statistics cookies. To see and add comments please accept statistics cookies.
There are no comments. Click here to write the first comment.