Currently have this to get a value from the registry in TSQL. However, I need to get the DigitalProductId and it does not return the value required. I think its stored as a binary in the registry.
Any ideas?
DECLARE @retvalue int, @data varchar(500)
EXECUTE @retvalue = master.dbo.xp_instance_regread 'HKEY_LOCAL_MACHINE',
'SOFTWARE\Microsoft\Windows NT\CurrentVersion',
'DigitalProductId', @param = @data OUTPUT
PRINT 'ProductId: '+ @data
Edit: I have updated the question and the code.