Sys. syscomments (Transact-SQL)
Items that contain each view, rule, DEFAULT value, trigger, CHECK constraint, DEFAULT constraint, and stored procedure in the database.TextThe column contains the original SQL Definition Statement.
|
Category: SQLServer |
Column name |
Data Type |
Description |
Id |
Int |
The object ID that applies to the text. |
Number |
Smallint |
The number in the process group. 0 = item is not a process. |
Colid |
Smallint |
The row serial number defined by the object that contains more than 4,000 characters. |
Status |
Smallint |
Marked as for reference only. Not supported. Future compatibility is not guaranteed. |
Ctext |
Varbinary (8000) |
The original bytes of the SQL Definition Statement. |
Texttype |
Smallint |
0 = user-provided comments 1 = comments provided by the system 4 = encrypted comment |
Language |
Smallint |
Marked as for reference only. Not supported. Future compatibility is not guaranteed. |
Encrypted |
Bit |
Indicates whether the process definition has been blurred. 0 = unprocessed 1 = blurred Important: To blur the definition of a stored PROCEDURE, use the create procedure statement with the ENCRYPTION keyword. |
Compressed |
Bit |
Always Returns 0. This value indicates that the process has been compressed. |
Text |
Nvarchar (4000) |
The actual text of the SQL Definition Statement. SQL Server 2008 decodes and stores the SQL expressions in the directory metadata in a different way than SQL Server 2000. The semantics of the decoded expression is equivalent to that of the original text, but there is no syntax guarantee. For example, space is deleted from the decoded expression. |
If exists (select * from dbo. syscomments where id = object_id (n' [dbo]. [P_XXXXX] ')
Select c. text as SQL statement, c. encrypted, convert (nchar (2), o. xtype) as type, datalength (c. text) as length from dbo. syscomments c, dbo. sysobjects o where o. id = c. id and c. id = object_id (n' [dbo]. [P _ comprehensive refund _ contract number with value 2] ') order by c. number, c. colid option (robust plan)