Sysobjects table
Each object created in the database (constraints, default values, logs, rules, stored procedures, etc.) occupies one row in the table. Each temporary object occupies one row in the table only in tempdb.
Column name data type description
Name sysname object name.
Id int ID of the object.
Xtype char (2) object type. It can be one of the following object types:
C = check Constraints
D = default value or default Constraint
F = foreign key constraint
L = Log
Fn = scalar function
If = embedded table functions
P = Stored Procedure
PK = primary key constraint (type: K)
Rf = copy and filter the Stored Procedure
S = system table
TF = table functions
Tr = trigger
U = User table
Uq = unique constraint (type is K)
V = View
X = Extended Stored Procedure
User ID of the UID smallint owner object.
Info smallint is retained. For internal use only.
Status int is retained. For internal use only.
Base_schema _
Ver int is retained. For internal use only.
Replinfo int is retained. For replication.
The object ID of the parent object of parent_obj int (for example, this ID is the table ID for triggers or constraints ).
The creation date of the crdate datetime object.
Ftcatid smallint is the full-text directory identifier of all user tables registered with the full-text index. It is 0 for all user tables not registered.
Schema_ver int version number, which increases each time the schema of the table is changed.
Stats_schema _
Ver int is retained. For internal use only.
Type char (2) object type. It can be one of the following values:
C = check Constraints
D = default value or default Constraint
F = foreign key constraint
Fn = scalar function
If = embedded table functions
K = primary key or unique constraint
L = Log
P = Stored Procedure
R = rule
Rf = copy and filter the Stored Procedure
S = system table
TF = table functions
Tr = trigger
U = User table
V = View
X = Extended Stored Procedure
Userstat smallint is retained.
Sysstat smallint internal status information.
Indexdel smallint is retained.
Refdate datetime is reserved for future use.
Version int is reserved for later use.
Deltrig int is retained.
Instrig int is retained.
Updtrig int is retained.
Seltrig int is retained.
CATEGORY int is used for publishing, constraints, and identifiers.
Cache smallint is retained.
Easy to use
Select * From sysobjects where xtype = 'tr' and parent_obj = object_id ('table name ')
Query table information
Xtype in the syscolumns table
After checking, these items are stored in the syscolumns table of each database. Name is the column name, xtype is the data type, but xtype is a number, the following figure shows the relationship between numbers and data types;
Xtype = 34 'image'
Xtype = 35 'text'
Xtype = 36 'uniqueidentifier'
Xtype = 48 'tinyint'
Xtype = 52 'smallint'
Xtype = 56 'int'
Xtype = 58 'smalldatetime'
Xtype = 59 'real'
Xtype = 60 'money'
Xtype = 61 'datetime'
Xtype = 62 'float'
Xtype = 98 'SQL _ variant'
Xtype = 99 'text'
Xtype = 104 'bit'
Xtype = 106 'decimal'
Xtype = 108 'numeric'
Xtype = 122 'smallmoney'
Xtype = 127 'bigint'
Xtype = 165 'varbinary'
Xtype = 167 'varchar'
Xtype = 173 'binary'
Xtype = 175 'Char'
Xtype = 189 'timestamp'
Xtype = 231 'nvarchar'
Xtype = 239 'nchar'
Xtype = 241 'xml'
Xtype = 231 'sysname'