Applies to all databases. syscomments contains entries for each view, rule, default, trigger, table constraint, partition, procedure, computed column, function-based index key, and other forms of compiled objects. The text column contains the original definition statements. If the text column is longer than 255 bytes, the entries span rows. Each object can occupy as many as 65,025 rows.
It also stores the text of a computed column, function-based index, or partition definition—for example, “values <= value_list” for a range partition.
The create service command stores text in syscomments, as it uses the create procedure infrastructure.
The columns for syscomments are:
Name |
Datatype |
Description |
---|---|---|
id |
int |
Object ID to which this text applies. |
number |
smallint |
Sub-procedure number when the procedure is grouped (0 for nonprocedure entries). |
colid |
smallint |
The low portion of a column counter for this procedure’s comments. Can vary from 0 to 32767. If a procedure has more text than fits in that many rows, this counter works together with colid2. |
texttype |
smallint |
Indicates the comment type. Values are:
|
language |
smallint |
Reserved. |
text |
varchar(255) null |
Actual text of SQL definition statement. |
colid2 |
smallint |
The high portion of a column counter for this procedure’s comments. Can vary from 0 to 32767. Is only greater than 0 for procedures containing more than 32,768 rows of procedure text. |
status |
smallint null |
Bits indicating the status of the objects:
|
version |
smallint null |
The version of encryption that encodes
the algorithm used to encrypt the hidden text for this row. One
of:
|
partitionid |
int null |
Partition ID. Otherwise, null. |
encrkeyid |
int null |
The encryption key ID from the key object in sysencryptkeys in the current database that the SAP ASE server used to encrypt the hidden text of this object when version has a value of 2. Otherwise, the SAP ASE server uses a value of null for encrkeyid. |
You can protect the text of a database object against unauthorized access by restricting select permission on the text column of the syscomments table to the owner of the object and the system administrator. This restriction, which applies to direct access through select statements as well as access through stored procedures, is required to run SAP ASE in the evaluated configuration. To enact this restriction, a system security officer must reset the parameter called select on syscomments.text using the system procedure sp_configure. For information about the evaluated configuration, see the Security Administration Guide: Volume 1.
Unique clustered index on id, number, colid2, colid, texttype