What Is sys.objects

Q

What Is sys.objects view in SQL Server?

✍: FYIcenter.com

A

sys.objects is a system view in a SQL Server Database that contains information about each data object like a table or an index used by the database.

Each record in the sys.objects table represents a single data object with the following key fields:

  • name - sysname: Object name.
  • object_id - int: Object identification number. Is unique within a database.
  • schema_id - int: ID of the schema that the object is contained in.
  • parent_object_id - int: ID of the object to which this object belongs.
  • type - char(2): Object type:
  • type_desc - nvarchar(60): Description of the object type:
  • create_date - datetime: Date the object was created.
  • modify_date - datetime: Date the object was last modified by using an ALTER statement. If the object is a table or a view, modify_date also changes when a clustered index on the table or view is created or altered.

Here is a list of records from sys.objects showing different types of data objects in a SQL Server database:

SELECT * FROM sys.objects

name           object_id   schema_id  type  type_desc               ...
ORDER_USER_ID  44648       1          F     FOREIGN_KEY_CONSTRAINT  ...
sqlagent_jobs  211197      4          IT    INTERNAL_TABLE          ...
INVOICE_PK     5670        1          PK    PRIMARY_KEY_CONSTRAINT  ...
ORDER_ID       56668       1          SO    SEQUENCE_OBJECT         ...
GET_ZIP        28652       1          FN    SQL_SCALAR_FUNCTION     ...
archive_user   19062       1          P     SQL_STORED_PROCEDURE    ...
USER_NEW       28662       1          TR    SQL_TRIGGER             ...
sysdbfiles     20          4          S     SYSTEM_TABLE            ...
ADDRESS        2115        1          U     USER_TABLE              ...

 

What Is OBJECT_ID()

List All Files in a Filegroup

SQL Server System Views and Functions

⇑⇑ SQL Server Storage Tutorials

2019-07-09, 1260🔥, 0💬