20 Undocumented T-SQL

An ounce of technique is worth a pound of technology.Danny Thorpe

I can’t stress enough how important it is to avoid relying on undocumented routines unless absolutely necessary. They’re undocumented for a reason. As a rule, the functions, DBCC command verbs, stored procedures, and trace flags that have been omitted from the SQL Server documentation have been left out because Microsoft doesn’t want you to use them. They can be dangerous—possibly even catastrophic—if used improperly. Wanton misuse of a DBMS’s undocumented features is a fast ticket to lost data and apathy from the vendor.

So be careful with the commands and syntax that follow. Use them sparingly and, even then, with due caution. A mangled server quickly ...

Get The Guru's Guide to Transact-SQL now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.