Sunday, November 11, 2012

access windows registry from sql server

This feature is really good
I got this from a post in a website.

use the following External Stored Procedures to access Windows Registry:

xp_Regread '<key>','<key value>','<string value>',@out output

xp_RegWrite
xp_RegDeletevalue
xp_regdeletekey
xp_regenumkeys

eg:

declare @out varchar(100)

EXECUTE master..xp_regread 'HKEY_LOCAL_MACHINE',
'SOFTWARE\Microsoft\Microsoft SQL Server\Services\SQL Server',
'Name', @out OUTPUT

select @out