SQL ServerEach database has this system table, which stores all objects created in the database, such as constraints, default values, logs,RulesAnd stored procedures. Each object occupies one row in the table.
The following table describes the field names and descriptions of the system table.
Column name |
Data Type |
Description |
Name |
Sysname |
Object Name. |
ID |
Int |
Object ID number. |
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 |
UID |
Smallint |
User ID of the owner object. |
Info |
Smallint |
Retained. For internal use only. |
Status |
Int |
Retained. For internal use only. |
Base_schema _ Ver |
Int |
Retained. For internal use only. |
Replinfo |
Int |
Retained. For replication. |
Parent_obj |
Int |
ID of the parent object (for example, this ID is the table ID for triggers or constraints ). |
Crdate |
Datetime |
Object creation date. |
Ftcatid |
Smallint |
The full-text directory identifier of all user tables registered for the full-text index. The value is 0 for all user tables not registered. |
Schema_ver |
Int |
Version number, which is added each time the schema of the table is changed. |
Stats_schema _ Ver |
Int |
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 |
Retained. |
Sysstat |
Smallint |
Internal status information. |
Indexdel |
Smallint |
Retained. |
Refdate |
Datetime |
For future use. |
Version |
Int |
For future use. |
Deltrig |
Int |
Retained. |
Instrig |
Int |
Retained. |
Updtrig |
Int |
Retained. |
Seltrig |
Int |
Retained. |
Category |
Int |
Used for publishing, binding, and identification. |
Cache |
Smallint |
Retained. |
WhenXtype = 'U' and status> 0Indicates the table created by the user. The object name is the table name and the objectIDIs the table'sIDValue.
Use the followingCodeYou can column out the warehouseMisaThe name of all tables created by the user.
Select * From Misa. DBO. sysobjects
Where Xtype = ' U ' And Status > 0
Binyou DatabaseUse ufdata_888_2004For example:
SQL code
-- Query the user table of the database ufdata_888_2004
Select * From Sysobjects
Where Xtype = ' U ' And Name Like ' Fa _ % '
Order By Name
-- Query the stored procedure of the database ufdata_888_2004
Select * From sysobjects
Where Xtype = ' P ' And Name Like ' Fa _ % '
Order By name
-- Query the trigger of the database ufdata_888_2004
Select * From sysobjects
Where Xtype = ' Tr ' And Name Like ' SA _ % '
Order By name