sp_helptext

sp_helptext now reports the text of user-defined functions.

sp_helptext also has some new parameters, numlines and printops:

sp_helptext objname [,grouping_num] [, numlines [, printopts]]]

numlines

Specifies the numbers of lines for which to generate SQL text. The meaning of this argument can change, depending on the output properties you specify in .If printops includes showsql, numlines is treated as the number of lines of SQL text to display. If printops also includes context, numlines is the context block width that surrounds the starting line number. In that case, the SQL text generated is the output for the stated number of lines of context blocked around the requested starting line number.

printops

Supports comma-separated properties of the output format, selected by the user. You can specify one or more of these print options, in any order, as a comma-separated string:

Noteddlgen and context are mutually exclusive print options. If you provide both, an error is raised.