Undocumented Stored Procedures … Do NOT Rely on Them in Production!

“Just because you can, does NOT mean you should.”  This is one of my favorite sayings that I like to apply in many aspects of my life, including when I am dealing with SQL Server.

For example, there are a lot of undocumented stored procedures that can be used and are very handy in certain situations (i.e. sp_MSforeachdb, sp_who2, xp_fixeddrives, xp_readerrorlog, etc.) (http://social.technet.microsoft.com/wiki/contents/articles/16975.sql-server-undocumented-stored-procedures.aspx)

However, I would NEVER suggest using undocumented stored procedures in production code, because they can be deprecated or modified by Microsoft without any notice, which will certainly cause problems. 

So, what should you do instead of using one of these undocumented stored procedures?

Build your own version of the stored procedure that mimic the functionality desired.  Here are a few ideas on how this can be done:

 So, although you could use undocumented stored procedures in many situations, you definitely should NOT use them in production code.

Advertisements
This entry was posted in DBA, Developer, TSQL and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s