sys.sysobjects (Transact-SQL)

sys.sysobjects (Transact-SQL)

 

THIS TOPIC APPLIES TO:yesSQL Server (starting with 2008)noAzure SQL DatabaseyesAzure SQL Data Warehouse yesParallel Data Warehouse

Contains one row for each object that is created within a database, such as a constraint, default, log, rule, and stored procedure.

System_CAPS_ICON_important.jpg Important


This SQL Server 2000 system table is included as a view for backward compatibility. We recommend that you use the current SQL Server system views instead. To find the equivalent system view or views, see Mapping System Tables to System Views (Transact-SQL). This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature.

Column nameData typeDescription
namesysnameObject name
idintObject identification number
xtypechar(2)Object type. Can be one of the following object types:

AF = Aggregate function (CLR)

C = CHECK constraint

D = Default or DEFAULT constraint

F = FOREIGN KEY constraint

L = Log

FN = Scalar function

FS = Assembly (CLR) scalar-function

FT = Assembly (CLR) table-valued function

IF = In-lined table-function

IT = Internal table

P = Stored procedure

PC = Assembly (CLR) stored-procedure

PK = PRIMARY KEY constraint (type is K)

RF = Replication filter stored procedure

S = System table

SN = Synonym

SQ = Service queue

TA = Assembly (CLR) DML trigger

TF = Table function

TR = SQL DML Trigger

TT = Table type

U = User table

UQ = UNIQUE constraint (type is K)

V = View

X = Extended stored procedure
uidsmallintSchema ID of the owner of the object. For databases upgraded from an earlier version of SQL Server, the schema ID is equal to the user ID of the owner. Overflows or returns NULL if the number of users and roles exceeds 32,767.

 ** Important ** If you use any of the following SQL Server DDL statements, you must use the sys.objects catalog view instead of sys.sysobjects.

CREATE | ALTER | DROP USER

CREATE | ALTER | DROP ROLE

CREATE | ALTER | DROP APPLICATION ROLE

CREATE SCHEMA

ALTER AUTHORIZATION ON OBJECT
infosmallintIdentified for informational purposes only. Not supported. Future compatibility is not guaranteed.
statusintIdentified for informational purposes only. Not supported. Future compatibility is not guaranteed.
base_schema_verintIdentified for informational purposes only. Not supported. Future compatibility is not guaranteed.
replinfointIdentified for informational purposes only. Not supported. Future compatibility is not guaranteed.
parent_objintObject identification number of the parent object. For example, the table ID if it is a trigger or constraint.
crdatedatetimeDate the object was created.
ftcatidsmallintIdentifier of the full-text catalog for all user tables registered for full-text indexing, and 0 for all user tables that are not registered.
schema_verintVersion number that is incremented every time the schema for a table changes. Always returns 0.
stats_schema_verintIdentified for informational purposes only. Not supported. Future compatibility is not guaranteed.
typechar(2)Object type. Can be one of the following values:

AF = Aggregate function (CLR)

C = CHECK constraint

D = Default or DEFAULT constraint

F = FOREIGN KEY constraint

FN = Scalar function

FS = Assembly (CLR) scalar-function

FT = Assembly (CLR) table-valued functionIF = In-lined table-function

IT - Internal table

K = PRIMARY KEY or UNIQUE constraint

L = Log

P = Stored procedure

PC = Assembly (CLR) stored-procedure

R = Rule

RF = Replication filter stored procedure

S = System table

SN = Synonym

SQ = Service queue

TA = Assembly (CLR) DML trigger

TF = Table function

TR = SQL DML Trigger

TT = Table type

U = User table

V = View

X = Extended stored procedure
userstatsmallintIdentified for informational purposes only. Not supported. Future compatibility is not guaranteed.
sysstatsmallintIdentified for informational purposes only. Not supported. Future compatibility is not guaranteed.
indexdelsmallintIdentified for informational purposes only. Not supported. Future compatibility is not guaranteed.
refdatedatetimeIdentified for informational purposes only. Not supported. Future compatibility is not guaranteed.
versionintIdentified for informational purposes only. Not supported. Future compatibility is not guaranteed.
deltrigintIdentified for informational purposes only. Not supported. Future compatibility is not guaranteed.
instrigintIdentified for informational purposes only. Not supported. Future compatibility is not guaranteed.
updtrigintIdentified for informational purposes only. Not supported. Future compatibility is not guaranteed.
seltrigintIdentified for informational purposes only. Not supported. Future compatibility is not guaranteed.
categoryintUsed for publication, constraints, and identity.
cachesmallintIdentified for informational purposes only. Not supported. Future compatibility is not guaranteed.

Mapping System Tables to System Views (Transact-SQL)
Compatibility Views (Transact-SQL)

Community Additions

ADD
Show:
© 2016 Microsoft