From the course: Developing Microsoft SQL Server 2016 Databases

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Use Dynamic Management Views

Use Dynamic Management Views

- [Narrator] Dynamic Management Views, or DMVs, return information about the state of the SQL Server instance. This information is useful for diagnosing problems and tuning performance. Dynamic Management Views come in two scopes: server and database. Server-scoped DMVs will require VIEW SERVER STATE permission on a server in order to execute them. Database-scoped DMVs require VIEW DATABASE STATE permission. Once you have the required permission level, running a Dynamic Management View is simply like running any other view in SQL Server. You'll select individual columns from the view to access the content. Microsoft has stated that the content of each view is subject to change between SQL Server versions, so avoid using SELECT * to obtain all of the view's columns if you're storing the SELECT statement in a production code environment. But if you're just taking a one-off look with an ad hoc query to get familiar with…

Contents