sp_helptext

Description

New parameters for sp_helptext.

Syntax

sp_helptext [, "objname" , linenum, numlines , "printoptions" ]

Parameters

linenum – specifies the starting line number from which the SQL text is generated.

numlines – specifies the number of lines for which to generate SQL text. If printoptions includes the term showsql, numlines specifies the number of lines of SQL text to display. If printoptions also includes the term context, numlines specifies the width of the context block surrounding linenum.

printoptions – a comma-separated list of terms specifying one or more properties for the output format, including:

Examples

Example 1 To generate the formatted text for sp_help:

sp_helptext sp_help, NULL, NULL, "showsql" 

Example 2 To generate the formatted SQL text for sp_help with line numbers:

sp_helptext sp_help, NULL, NULL,"showsq	l,linenumbers"

Example 3 To generate a context block of 7 lines, starting at line 25, with line numbers generated in a comment block:

sp_helptext sp_help, 25, 7, 
		"showsql, linenumbers, comments, context"

Usage