Reading Registry Entries...
You have a couple of options..
1. Use undo***ented xp_Regread & xp_RegWrite extended procedures:
---xp_regread
DECLARE @v varchar(20)
EXEC master..xp_regread @rootkey='HKEY_LOCAL_MACHINE',
@key='SOFTWARE\Test',
@value_name='TestValue',
@value=@vOUTPUT
SELECT @test
---xp_regwrite
EXEC master..xp_regwrite @rootkey='HKEY_LOCAL_MACHINE',
@key='SOFTWARE\Test',
@value_name='TestValue',
@type='REG_SZ',
@value='Test'
Note that these are undo***ented & hence are not recommended as a stable
long-term solution.
2. Use sp_OA* procedures:
http://www.sqlmag.com/Files/09/19836/Listing_01.txt
The invocation of a COM object using sp_OA* procedure is under the security
context of the SQL Server service account. Since this may prevent
reading/writing the Registry, you have to run the service with sufficient
security permissions to access the registry.
--
- Anith
( Please reply to newsgroups only )
|