• Great article Dinesh!

    I agree with you that accessing registry keys from SQL Server scripts/stored procedures is not something that you will do often, but is great to know that you actually "can" do it if you want.

    I think that maybe this extended stored procedures can be useful as a good alternative to logged operations (compared to logging in the event log or somewhere else) or to keep configuration information in the registry (buffer size for cursors, type of locking, or whatever you can think of) by pointing your sp's to read to a particular registry. Then, if you want to try your sp's with different configurations you don't have to modify all of them, simply change that registry key...

    Other ideas would be to keep on the registry the name of files where your stored procedures will write debugging information. Then, if you decide to move your debugging files somewhere else, just change the registry.

    The Isn't weird?... you can even change the desktop background from a stored procedure!.. the limits of the registry key are endless if you know how to use it...

    Thanks!