sys.dm_server_registry – New Dynamic Management View (DMV) in SQL Server 2012

sys.dm_server_registry – New Dynamic Management View (DMV) in SQL Server 2012

As I said earlier either that SQL Server giving more & more power to the administrator of SQL Server by making SQL Server related information available in SQL Server Management Studio directly. Information is two side bladed swords, if you don’t use it wisely than you will be in trouble.

Note: Registry is very sensitive part and change without actually know what exactly you are doing, you will be in trouble.

So far, if you wanted to get some registry level information for SQL Server, you had, mostly, two options.

1.)    Go to registry from Windows

2.)    Use “xp_RegRead” extended stored procedure

SQL Server 2012 is giving you better way to handle this by providing sys.dm_server_registry. You can simply query this new dynamic management view and find all SQL Server related registry with its name and value right from your SQL Server Management Studio. Isn’t it fantastic?

You can set alert email by querying some important value in SQL Server JOB. For example you would like to get an email whenever port of SQL Server changes.

Let us now query this DMV and see its result:

 SELECT * FROM sys.dm_server_registry 

Here is the output of above query :

You can read my earlier article I written for “XP_RegRead” from here.

If you like this article, do like “Extreme-Advice” page in Facebook.

Reference: Ritesh Shah

http://Extreme-Advice.com

http://www.sqlhub.com

Note: Microsoft Books online is a default reference of all articles.