This weeks tip:
What’s the fastest animal on earth? The Cheetah.
What’s the fastest way to get a definition of a unencrypted stored procedure? Use SP_HELPTEXT
If you don’t know, SP_HELPTEXT returns, in the results pane (use ALT+T to put the results to text), the TSQL of the following:
- unencrypted stored procedure
- view
- trigger
- user-defined function
- user-defined rule
- default
- computed column
- CHECK constraint
- system object
Here’s an example from the AdventureWorks database…..
SP_HELPTEXT uspGetBillOfMaterials
Here are some related posts from the intraweb:
- I found an article from Jason Strate here: I don’t Want To Use the Object Browser (sp_helptext)
- A couple good alternatives from Belle’s SQL Musings here: How to Get Definition for Stored Procedures, UDFs and Triggers using T-SQL


