syscomments

Transact-SQL Reference

Transact-SQL Reference

syscomments

Contains entries for each view, rule, default, trigger, CHECK constraint, DEFAULT constraint, and stored procedure. The text column contains the original SQL definition statements, which are limited to a maximum size of 4 MB. This table is stored in each database.

Important  None of the entries in syscomments should be deleted. If an entry in syscomments is manually removed or modified, the corresponding stored procedure will not function properly. To hide or encrypt stored procedure definitions, use CREATE PROCEDURE with the ENCRYPTION keyword.

Column name Data type Description
id int Object ID to which this text applies.
number smallint Number within procedure grouping, if grouped.  0 for entries that are not procedures.
colid smallint Row sequence number for object definitions longer than 4,000 characters.
status smallint For internal use only.
ctext varbinary(8000) Actual text of the SQL definition statement.
texttype smallint 0 = User-supplied comment.
1 = System-supplied comment.
4 = Encrypted comment.
language smallint For internal use only.
encrypted bit Indicates whether the procedure is encrypted.

0 = Not encrypted.
1 = Encrypted.

compressed bit Indicates whether or not the procedure is compressed.

0 = Not compressed
1 = Compressed

text nvarchar(4000) Actual text of the SQL definition statement.