Wednesday, July 16, 2008

Delete from Registry using SQL

xp_regdeletekey and xp_regdeletevalue are the two undocumented stored procedures that helps in deleting values and keys from registry. These stored procedures should be used very vary carefully as there are chances of harming the system and system may crash.

xp_regdeletekey
This is an extended stored procedure that will delete an entire key from the registry.
EXEC xp_regdeletekey @rootkey,@key
Example:-
EXEC master..xp_regdeletekey @rootkey='HKEY_LOCAL_MACHINE',
@key='SOFTWARE\Test'

xp_regdeletevalue

This is an extended stored procedure that will delete a particular value for a key in the registry.

EXEC xp_regdeletevalue @rootkey,@key,@value_name

Example:-

EXEC master..xp_regdeletevalue @rootkey='HKEY_LOCAL_MACHINE', @key='SOFTWARE\Test', @value_name='TestValue'

4 comments:

  1. Garage door companies in CT offer a wide range of services and products for garage doors. They install, repair, and maintain garage doors. They also offer emergency services 24/7 in case of any emergency such as when your garage door is stuck or broken.

    ReplyDelete
  2. Well explained article to use SQL in better way. By getting our Commercial Electrical Services Los Angeles CA, you can get reasonable rates, certified electricians, quality material, and emergency services.

    ReplyDelete
  3. I've seen businesses leverage the creativity of designers like Shaheryar Q. on Upwork to create postcards design for your business
    that grab attention and convey their brand message effectively.

    ReplyDelete