|
|
-
|
|
sys.computed_columns returns all columns that are computed in the database, below
are some of the columns returned by sys.computed_columns:
1. Object_id – object id of the table to which the column belongs,
2. Name – name of the computed column,
3. Column_......
|
|
-
|
|
While
sys.check_constraints returns all CHECK constraints in the database,
sys.key_constraints and sys.default_constraints returns primary/unique key constraints
and DEFAULT constraints respectively.
some of the columns returned by sys.key_constraints are:
1. ......
|
|
-
|
|
sys.sql_modules returns a row for each function, procedure, trigger, view and rules defined in the database. Below are some of the columns returned by sys.sql_modules:
1. Object_ID – ID of the object in the database,
2. Definition – module text,
3. Uses_ansi_null – 1 if module w......
|
|
-
|
|
sys.views returns a row for each view in the database, sys.views only returns rows for which the user owns or has been granted permission for. Below are some of the columns returned by sys.views.
1. Name – Give name of the view,
2. Schema_id – ID of schema to which the view belongs,
3......
|
|
-
|
|
sys.foreign_keys contains a list of all FOREIGN KEYS in the database. It contains one row per FOREIGN KEY. Below is a list of some columns returned by this view:
1. Name – FOREIGN KEY name,
2. Schema_ID – Schema ID of the parent object,
3. Parent_Object_ID – ID of the object to ......
|
|
-
|
|
sys.sql_expression_dependencies catalog view contains a row for each dependent object which references another object in the database. For example, if a view uses a tables in it’s definition, then the view depends on the table.
For example, the view HumanResources.vEmployee in AdvendureWorks2......
|
|
-
|
|
sys.procedures contains a row for each stored procedure in the database. Below are some useful columns returned by sys.procedures.
1. Name – name of the stored procedure,
2. Object_ID – object id of the procedure
3. Type – type of procedure, it can be P = SQL Stored Procedure, X......
|
|
-
|
|
sys.check_constraints contains a row for each CHECK constraint. It contains below useful columns:
1. parent_column_id – column id for which CHECK constraint is defined
2. parent_object_id – id of the object for whose column the constraint is defined.
3. create/modify_date – crea......
|
|
-
|
|
sys.dm_db_task_space_usage contains details for allocation/de-allocation pages for activity tasks for database.
It returns below columns:
1. session_id – session id
2. request_id – request id within the session, i.e. execution batch within a session
3. database_id – will always......
|
|
-
|
|
While you can use sys.dm_db_file_space_usage to get the free space available in tempdb. you can use sys.dm_db_session_space_usage to get the used space by each session.
sys.dm_db_session_space_usage contains following columns:
1. session_id – session_id
2. database_id – will always be......
|
|