Can I work with registry from within T-SQL ?
Yes, you can. There are many extended stored procedures shipped with SQL Server and not all of them have been described in the SQL Server manuals. There are four very useful extended stored procedures to work with registry. There are: xp_regread, xp_regwrite, xp_regdeletevalue and xp_regdeletekey.