How to read registry entries for SQL?