Chapter 22. Undocumented Transact-SQL

for RuBoard

To a great designer, not applying knowledge is tantamount to not having obtained the knowledge in the first place.

Steve McConnell [1]

[1] McConnell, Steve. After the Gold Rush . Redmond, WA:Microsoft Press, 1999. Page 27.

You're better off not using undocumented features unless there's just no other way. Undocumented features are usually undocumented for good reason: They may be unsafe to use in certain circumstances, or they may change or be removed in future releases. Misuse of a product's undocumented features is a fast ticket to lost data and indifference from the vendor.

So be careful with the undocumented stored procedures, commands, functions, and syntax I'm about to share with you. Use them at your own risk. The elation one feels on discovering a hidden feature is nothing compared with the humiliation that comes with the realization that, for no good reason, you've just corrupted a production server on which lots of people depend. Take it from someone who knows : The excruciating pain that comes from shooting yourself in the foot is a lot more intense and long- lasting than that momentary Eureka feeling you experience when you figure out some heretofore unknown keyword. Keep things in perspective. Using an undocumented feature in a production environment is usually not worth the risk.

If you evaluate the risks and decide to use undocumented features anyway, realize that these features may change or be removed from the product without notice. An example of such a feature is the PWDENCRYPT() function. It changed between releases 6.5 and 7.0 of SQL Server, breaking code that depended on the old behavior when it was migrated to 7.0.

In terms of support, understand that "undocumented" means "unsupported." Don't expect vendor support for undocumented features. Microsoft has intentionally left certain features out of the product documentation because it knows they will be changing or will be removed in future releases of SQL Server. It wants to be able to change these features without worrying about breaking customer code. If you base production code on undocumented features, you accept the fact that your code may break in the future because of changes in the product, or may even be unsafe in the present because you're using undocumented features in ways they were never intended to be used.

for RuBoard


The Guru[ap]s Guide to SQL Server[tm] Stored Procedures, XML, and HTML
The Guru[ap]s Guide to SQL Server[tm] Stored Procedures, XML, and HTML
ISBN: 201700468
EAN: N/A
Year: 2005
Pages: 223

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net