SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Working with the Registry


Working with the Registry

Author
Message
Dinesh Asanka
Dinesh Asanka
Hall of Fame
Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)

Group: General Forum Members
Points: 3900 Visits: 223
Comments posted to this topic are about the content posted at http://www.sqlservercentral.com/columnists/dasanka/w






My Blog: http://dineshasanka.spaces.live.com/
msurasky
msurasky
SSC-Enthusiastic
SSC-Enthusiastic (135 reputation)SSC-Enthusiastic (135 reputation)SSC-Enthusiastic (135 reputation)SSC-Enthusiastic (135 reputation)SSC-Enthusiastic (135 reputation)SSC-Enthusiastic (135 reputation)SSC-Enthusiastic (135 reputation)SSC-Enthusiastic (135 reputation)

Group: General Forum Members
Points: 135 Visits: 1

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!





samm2425
samm2425
SSC-Enthusiastic
SSC-Enthusiastic (119 reputation)SSC-Enthusiastic (119 reputation)SSC-Enthusiastic (119 reputation)SSC-Enthusiastic (119 reputation)SSC-Enthusiastic (119 reputation)SSC-Enthusiastic (119 reputation)SSC-Enthusiastic (119 reputation)SSC-Enthusiastic (119 reputation)

Group: General Forum Members
Points: 119 Visits: 1

awesome article

gr8 way for getting values out of the registry.

Thanks.





Dinesh Asanka
Dinesh Asanka
Hall of Fame
Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)

Group: General Forum Members
Points: 3900 Visits: 223
Thankx all .but credit should also goes to Frank Kalis as well.






My Blog: http://dineshasanka.spaces.live.com/
Frank Kalis
Frank Kalis
One Orange Chip
One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)

Group: General Forum Members
Points: 29677 Visits: 289
Thanks Dinesh!

There is just one thing I like to add.
All of these procedures are undocumented and subject to change anytime at Microsoft's will. I would really carefully think about this BEFORE writing production code with these procedures.

Nonetheless I agree it's good to know that there is a way, but then again there are also many other ways. I would prefer doing this in the application layer.

--
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org/blogs
My blog: http://www.insidesql.org/blogs/frankkalis/
Dinesh Asanka
Dinesh Asanka
Hall of Fame
Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)

Group: General Forum Members
Points: 3900 Visits: 223

Yes Frank,

I fully agree with you.

Yes I has to be used as the LAST OPTION. Sorry I didn't mention that in my article.








My Blog: http://dineshasanka.spaces.live.com/
Frank Kalis
Frank Kalis
One Orange Chip
One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)

Group: General Forum Members
Points: 29677 Visits: 289
Please don't get me wrong. My reply wasn't meant to be criticism, but rather calling attention on this nasty side-effect of using something undocumented.



--
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org/blogs
My blog: http://www.insidesql.org/blogs/frankkalis/
Dinesh Asanka
Dinesh Asanka
Hall of Fame
Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)

Group: General Forum Members
Points: 3900 Visits: 223
No Frank. It is no criticism but it is a fact






My Blog: http://dineshasanka.spaces.live.com/
Dinesh Asanka
Dinesh Asanka
Hall of Fame
Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)

Group: General Forum Members
Points: 3900 Visits: 223
Thankx all for your comments which help me lot






My Blog: http://dineshasanka.spaces.live.com/
JT Lovell
JT Lovell
SSC-Addicted
SSC-Addicted (422 reputation)SSC-Addicted (422 reputation)SSC-Addicted (422 reputation)SSC-Addicted (422 reputation)SSC-Addicted (422 reputation)SSC-Addicted (422 reputation)SSC-Addicted (422 reputation)SSC-Addicted (422 reputation)

Group: General Forum Members
Points: 422 Visits: 3

Great article, thanks for sharing it! It's probably important to point out that it is the server's registry that is being used, rather than the client's.


Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search