Skip to content

Latest commit

 

History

History
63 lines (57 loc) · 5.63 KB

sys-sysobjects-transact-sql.md

File metadata and controls

63 lines (57 loc) · 5.63 KB
title description author ms.author ms.reviewer ms.date ms.service ms.subservice ms.topic f1_keywords helpviewer_keywords dev_langs monikerRange
sys.sysobjects (Transact-SQL)
Contains one row for each object that is created within a database, such as a constraint, default, log, rule, and stored procedure.
rwestMSFT
randolphwest
randolphwest
09/10/2022
sql
system-objects
reference
sys.sysobjects_TSQL
sysobjects
sysobjects_TSQL
sys.sysobjects
sys.sysobjects compatibility view
sysobjects system table
TSQL
>=aps-pdw-2016||=azure-sqldw-latest||>=sql-server-2016||>=sql-server-linux-2017||=azuresqldb-mi-current||=fabric

sys.sysobjects (Transact-SQL)

[!INCLUDE sql-asdbmi-asa-pdw-fabricse-fabricdw]

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

Important

[!INCLUDEssnoteCompView]

Column name Data type Description
name sysname Object name
id int Object identification number
xtype char(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
SO = Sequence
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
uid smallint Schema ID of the owner of the object. For databases upgraded from an earlier version of [!INCLUDEssNoVersion], 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 [!INCLUDEssNoVersion] 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
info smallint [!INCLUDEssInternalOnly]
status int [!INCLUDEssInternalOnly]
base_schema_ver int [!INCLUDEssInternalOnly]
replinfo int [!INCLUDEssInternalOnly]
parent_obj int Object identification number of the parent object. For example, the table ID if it is a trigger or constraint.
crdate datetime Date the object was created.
ftcatid smallint Identifier 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_ver int Version number that is incremented every time the schema for a table changes. Always returns 0.
stats_schema_ver int [!INCLUDEssInternalOnly]
type char(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
userstat smallint [!INCLUDEssInternalOnly]
sysstat smallint [!INCLUDEssInternalOnly]
indexdel smallint [!INCLUDEssInternalOnly]
refdate datetime [!INCLUDEssInternalOnly]
version int [!INCLUDEssInternalOnly]
deltrig int [!INCLUDEssInternalOnly]
instrig int [!INCLUDEssInternalOnly]
updtrig int [!INCLUDEssInternalOnly]
seltrig int [!INCLUDEssInternalOnly]
category int Used for publication, constraints, and identity.
cache smallint [!INCLUDEssInternalOnly]

See also