SQL Server contains several extended stored procedures that can access the system registry. But in fact these extended stored procedures are undisclosed, from SQL Server 7.0, still retain in SQL Server 2000, they may Will delete. But these stored procedures provide the ability to access the system registry in the current SQL Server version, and many people use SQL Server to attack the system, often use these extended stored procedures. So It is best to use them in SQL Server. XP_RegenumValues Returns all key values in multiple record sets: XP_REGENUMVALUES registration table Root key, child bore, want to see all HKEY_LOCAL_MACHINE / SOFTWARE / Microsoft / Windows / CurrentVersion / Run key: use master exec xp_regenumvalues' HKEY_LOCAL_MACHINE ',' SOFTWARE / Microsoft / Windows / CurrentVersion / Run 'xp_regread return value to use to develop key: xp_regread root key, sub-key, key names use master exec xp_regread' HKEY_LOCAL_MACHINE ',' SOFTWARE / Microsoft / Windows / CurrentVersion ',' CommonFilesDir 'xp_regwrite written to the registry to use: xp_regwrite root key, sub-key, value name, value type, value, use master exec xp_regwrite' HKEY_LOCAL_MACHINE ',' SOFTWARE / Microsoft / Windows / CurrentVersion ',' TestValuename ',' REG_SZ ',' Hello 'Note Type There are two reg_sz represent characters, REG_DWORD represents integer xp_regdeletevalue deletes a value usage: XP_REGDELETEVALUE root key, subkey, value name User EXEC XP_REGDELETEVALUE' HKEY_LOCAL_MACHINE ',' Software / Microsoft / Windows / CurrentVersion ',' TestValuename 'X P_regDeleteKey Delete Keys, including all values under this key: use master xp_regdeletekey 'hkey_local_machine', 'Software / Microsoft / Windows / CurrentVersion / TestKey'