You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|object_id|**int**|ID of the object to which this column belongs.|
43
-
|name|**sysname**|Name of the column. Is unique within the object.|
44
-
|column_id|**int**|ID of the column. Is unique within the object.<br /><br /> Column IDs might not be sequential.|
45
-
|system_type_id|**tinyint**|ID of the system type of the column.|
46
-
|user_type_id|**int**|ID of the type of the column as defined by the user.<br /><br /> To return the name of the type, join to the [sys.types](../../relational-databases/system-catalog-views/sys-types-transact-sql.md) catalog view on this column.|
47
-
|max_length|**smallint**|Maximum length (in bytes) of the column.<br /><br /> -1 = Column data type is **varchar(max)**, **nvarchar(max)**, **varbinary(max)**, or **xml**.<br /><br /> For **text**, **ntext**, and **image** columns, the max_length value will be 16 (representing the 16-byte pointer only) or the value set by sp_tableoption 'text in row'.|
48
-
|precision|**tinyint**|Precision of the column if numeric-based; otherwise, 0.|
49
-
|scale|**tinyint**|Scale of column if numeric-based; otherwise, 0.|
50
-
|collation_name|**sysname**|Name of the collation of the column if character-based; otherwise `NULL`.|
51
-
|is_nullable|**bit**|1 = Column is nullable.|
52
-
|is_ansi_padded|**bit**|1 = Column uses ANSI_PADDING ON behavior if character, binary, or variant.<br /><br /> 0 = Column is not character, binary, or variant.|
53
-
|is_rowguidcol|**bit**|1 = Column is a declared ROWGUIDCOL.|
54
-
|is_identity|**bit**|1 = Column has identity values|
55
-
|is_computed|**bit**|1 = Column is a computed column.|
56
-
|is_filestream|**bit**|1 = Column is a FILESTREAM column.|
57
-
|is_replicated|**bit**|1 = Column is replicated.|
58
-
|is_non_sql_subscribed|**bit**|1 = Column has a non-SQL Server subscriber.|
59
-
|is_merge_published|**bit**|1 = Column is merge-published.|
60
-
|is_dts_replicated|**bit**|1 = Column is replicated by using [!INCLUDE[ssIS](../../includes/ssis-md.md)].|
61
-
|is_xml_document|**bit**|1 = Content is a complete XML document.<br /><br /> 0 = Content is a document fragment or the column data type is not **xml**.|
62
-
|xml_collection_id|**int**|Nonzero if the data type of the column is **xml** and the XML is typed. The value will be the ID of the collection containing the validating XML schema namespace of the column.<br /><br /> 0 = No XML schema collection.|
63
-
|default_object_id|**int**|ID of the default object, regardless of whether it is a stand-alone object [sys.sp_bindefault](../../relational-databases/system-stored-procedures/sp-bindefault-transact-sql.md), or an inline, column-level DEFAULT constraint. The parent_object_id column of an inline column-level default object is a reference back to the table itself.<br /><br /> 0 = No default.|
64
-
|rule_object_id|**int**|ID of the stand-alone rule bound to the column by using sys.sp_bindrule.<br /><br /> 0 = No stand-alone rule. For column-level CHECK constraints, see [sys.check_constraints (Transact-SQL)](../../relational-databases/system-catalog-views/sys-check-constraints-transact-sql.md).|
65
-
|is_sparse|**bit**|1 = Column is a sparse column. For more information, see [Use Sparse Columns](../../relational-databases/tables/use-sparse-columns.md).|
66
-
|is_column_set|**bit**|1 = Column is a column set. For more information, see [Use Sparse Columns](../../relational-databases/tables/use-sparse-columns.md).|
67
-
|generated_always_type|**tinyint**|**Applies to**: [!INCLUDE[sssql16-md](../../includes/sssql16-md.md)] and later, [!INCLUDE[ssSDS_md](../../includes/sssds-md.md)]. 5, 6, 7, 8 only applies to [!INCLUDE[ssSDS_md](../../includes/sssds-md.md)].<br /><br /> Identifies when the column value is generated (will always be 0 for columns in system tables):<br /><br /> 0 = NOT_APPLICABLE<br /> 1 = AS_ROW_START<br /> 2 = AS_ROW_END<br />5 = AS_TRANSACTION_ID_START<br />6 = AS_TRANSACTION_ID_END<br />7 = AS_SEQUENCE_NUMBER_START<br />8 = AS_SEQUENCE_NUMBER_END<br /><br /> For more information, see [Temporal Tables (Relational databases)](../../relational-databases/tables/temporal-tables.md).|
68
-
|generated_always_type_desc|**nvarchar(60)**|**Applies to**: [!INCLUDE[sssql16-md](../../includes/sssql16-md.md)] and later, [!INCLUDE[ssSDS_md](../../includes/sssds-md.md)].<br /><br /> Textual description of `generated_always_type`'s value (always NOT_APPLICABLE for columns in system tables) <br /><br /> NOT_APPLICABLE<br /> AS_ROW_START<br /> AS_ROW_END<br /><br />**Applies to**: Starting with [!INCLUDE [sssql22-md](../../includes/sssql22-md.md)], [!INCLUDE[ssSDS_md](../../includes/sssds-md.md)]<br /><br />AS_TRANSACTION_ID_START<br />AS_TRANSACTION_ID_END<br />AS_SEQUENCE_NUMBER_START<br />AS_SEQUENCE_NUMBER_END|
|encryption_type_desc|**nvarchar(64)**|**Applies to**: [!INCLUDE[sssql16-md](../../includes/sssql16-md.md)] and later, [!INCLUDE[ssSDS_md](../../includes/sssds-md.md)].<br /><br /> Encryption type description:<br /><br /> RANDOMIZED<br /><br /> DETERMINISTIC|
71
-
|encryption_algorithm_name|**sysname**|**Applies to**: [!INCLUDE[sssql16-md](../../includes/sssql16-md.md)] and later, [!INCLUDE[ssSDS_md](../../includes/sssds-md.md)].<br /><br /> Name of encryption algorithm.<br /><br /> Only AEAD_AES_256_CBC_HMAC_SHA_512 is supported.|
72
-
|column_encryption_key_id|**int**|**Applies to**: [!INCLUDE[sssql16-md](../../includes/sssql16-md.md)] and later, [!INCLUDE[ssSDS_md](../../includes/sssds-md.md)].<br /><br /> ID of the CEK.|
73
-
|column_encryption_key_database_name|**sysname**|**Applies to**: [!INCLUDE[sssql16-md](../../includes/sssql16-md.md)] and later, [!INCLUDE[ssazuresynapse-md](../../includes/sssds-md.md)].<br /><br /> The name of the database where the column encryption key exists if different than the database of the column. `NULL` if the key exists in the same database as the column.|
74
-
|is_hidden|**bit**|**Applies to**: [!INCLUDE [sssql16-md](../../includes/sssql16-md.md)] and later, [!INCLUDE[ssSDS_md](../../includes/sssds-md.md)].<br /><br /> Indicates if the column is hidden:<br /><br /> 0 = regular, not-hidden, visible column<br /><br /> 1 = hidden column|
75
-
|is_masked|**bit**|**Applies to**: [!INCLUDE [sssql16-md](../../includes/sssql16-md.md)] and later, [!INCLUDE[ssSDS_md](../../includes/sssds-md.md)].<br /><br /> Indicates if the column is masked by a dynamic data masking:<br /><br /> 0 = regular, not-masked column<br /><br /> 1 = column is masked|
76
-
|graph_type |**int**|Internal column with a set of values. The values are between 1-8 for graph columns and `NULL` for others. |
77
-
|graph_type_desc |**nvarchar(60)**|internal column with a set of values |
78
-
|is_data_deletion_filter_column|**bit**|**Applies to**: Azure SQL Edge. Indicates if the column is the data retention filter column for the table.|
79
-
|ledger_view_column_type|**tinyint**|**Applies to**: Starting with [!INCLUDE [sssql22-md](../../includes/sssql22-md.md)], [!INCLUDE[ssSDS_md](../../includes/sssds-md.md)].<br /><br /> If not NULL, indicates the type of a column in a ledger view:<br /><br /> 1 = TRANSACTION_ID<br /> 2 = SEQUENCE_NUMBER<br /> 3 = OPERATION_TYPE<br /> 4 = OPERATION_TYPE_DESC<br/><br/>For more information on database ledger, see [Ledger](/azure/azure-sql/database/ledger-overview).|
80
-
|ledger_view_column_type_desc|**nvarchar(60)**|**Applies to**: Starting with [!INCLUDE [sssql22-md](../../includes/sssql22-md.md)], [!INCLUDE[ssSDS_md](../../includes/sssds-md.md)].<br /><br /> If not NULL, contains a textual description of the the type of a column in a ledger view:<br /><br /> TRANSACTION_ID<br /> SEQUENCE_NUMBER<br /> OPERATION_TYPE<br /> OPERATION_TYPE_DESC|
81
-
|is_dropped_ledger_table_column|**bit**|**Applies to**: Starting with [!INCLUDE [sssql22-md](../../includes/sssql22-md.md)], [!INCLUDE[ssSDS_md](../../includes/sssds-md.md)].<br /><br /> Indicates a ledger table column that has been dropped.|
24
+
Returns a row for each column of an object that has columns, such as views or tables. The following list contains the object types that have columns:
82
25
83
-
## Permissions
26
+
- Table-valued assembly functions (FT)
27
+
- Inline table-valued SQL functions (IF)
28
+
- Internal tables (IT)
29
+
- System tables (S)
30
+
- Table-valued SQL functions (TF)
31
+
- User tables (U)
32
+
- Views (V)
84
33
85
-
[!INCLUDE[ssCatViewPerm](../../includes/sscatviewperm-md.md)] For more information, see [Metadata Visibility Configuration](../../relational-databases/security/metadata-visibility-configuration.md).
86
-
87
-
## See Also
34
+
| Column name | Data type | Description |
35
+
| --- | --- | --- |
36
+
|`object_id`|**int**| ID of the object to which this column belongs. |
37
+
|`name`|**sysname**| Name of the column. Is unique within the object. |
38
+
|`column_id`|**int**| ID of the column. Is unique within the object. Column IDs might not be sequential. |
39
+
|`system_type_id`|**tinyint**| ID of the system type of the column. |
40
+
|`user_type_id`|**int**| ID of the type of the column as defined by the user. To return the name of the type, join to the [sys.types](sys-types-transact-sql.md) catalog view on this column. |
41
+
|`max_length`|**smallint**| Maximum length (in bytes) of the column.<br /><br />`-1` = Column data type is **varchar(max)**, **nvarchar(max)**, **varbinary(max)**, or **xml**.<br /><br />For **text**, **ntext**, and **image** columns, the max_length value is `16` (representing the 16-byte pointer only) or the value set by `sp_tableoption 'text in row'`. |
42
+
|`precision`|**tinyint**| Precision of the column if numeric-based; otherwise, `0`. |
43
+
|`scale`|**tinyint**| Scale of column if numeric-based; otherwise, `0`. |
44
+
|`collation_name`|**sysname**| Name of the collation of the column if character-based; otherwise `NULL`. |
|`is_ansi_padded`|**bit**|`1` = Column uses `ANSI_PADDING ON` behavior if character, binary, or variant<br /><br />`0` = Column isn't character, binary, or variant |
47
+
|`is_rowguidcol`|**bit**|`1` = Column is a declared `ROWGUIDCOL`|
48
+
|`is_identity`|**bit**|`1` = Column has identity values |
49
+
|`is_computed`|**bit**|`1` = Column is a computed column |
50
+
|`is_filestream`|**bit**|`1` = Column is a FILESTREAM column |
51
+
|`is_replicated`|**bit**|`1` = Column is replicated |
52
+
|`is_non_sql_subscribed`|**bit**|`1` = Column has a non-SQL Server subscriber |
53
+
|`is_merge_published`|**bit**|`1` = Column is merge-published |
54
+
|`is_dts_replicated`|**bit**|`1` = Column is replicated by using [!INCLUDE [ssIS](../../includes/ssis-md.md)]|
55
+
|`is_xml_document`|**bit**|`1` = Content is a complete XML document<br /><br />`0` = Content is a document fragment, or the column data type isn't **xml**|
56
+
|`xml_collection_id`|**int**| Nonzero if the data type of the column is **xml** and the XML is typed. The value is the ID of the collection containing the validating XML schema namespace of the column<br /><br />`0` = No XML schema collection |
57
+
|`default_object_id`|**int**| ID of the default object, regardless of whether it's a stand-alone object [sp_bindefault](../system-stored-procedures/sp-bindefault-transact-sql.md), or an inline, column-level `DEFAULT` constraint. The parent_object_id column of an inline column-level default object is a reference back to the table itself.<br /><br />`0` = No default |
58
+
|`rule_object_id`|**int**| ID of the stand-alone rule bound to the column by using `sys.sp_bindrule.`<br /><br />`0` = No stand-alone rule. For column-level `CHECK` constraints, see [sys.check_constraints](sys-check-constraints-transact-sql.md). |
59
+
|`is_sparse`|**bit**|`1` = Column is a sparse column. For more information, see [Use sparse columns](../tables/use-sparse-columns.md). |
60
+
|`is_column_set`|**bit**|`1` = Column is a column set. For more information, see [Use sparse columns](../tables/use-sparse-columns.md). |
61
+
|`generated_always_type`|**tinyint**| Identifies when the column value is generated (is always `0` for columns in system tables).<br /><br />**Applies to**: [!INCLUDE [sssql16-md](../../includes/sssql16-md.md)] and later versions, and [!INCLUDE [ssSDS_md](../../includes/sssds-md.md)].<br /><br />`0` = `NOT_APPLICABLE`<br />`1` = `AS_ROW_START`<br />`2` = `AS_ROW_END`<br /><br />**Applies to**: [!INCLUDE [sssql22-md](../../includes/sssql22-md.md)] and later versions, and [!INCLUDE [ssSDS_md](../../includes/sssds-md.md)].<br /><br />`5` = `AS_TRANSACTION_ID_START`<br />`6` = `AS_TRANSACTION_ID_END`<br />`7` = `AS_SEQUENCE_NUMBER_START`<br />`8` = `AS_SEQUENCE_NUMBER_END`<br /><br />For more information, see [Temporal Tables (Relational databases)](../tables/temporal-tables.md). |
62
+
|`generated_always_type_desc`|**nvarchar(60)**| Textual description of the `generated_always_type` value (always `NOT_APPLICABLE` for columns in system tables)<br /><br />**Applies to**: [!INCLUDE [sssql16-md](../../includes/sssql16-md.md)] and later versions, and [!INCLUDE [ssSDS_md](../../includes/sssds-md.md)].<br /><br />`NOT_APPLICABLE`<br />`AS_ROW_START`<br />`AS_ROW_END`<br /><br />**Applies to**: [!INCLUDE [sssql22-md](../../includes/sssql22-md.md)] and later versions, and [!INCLUDE [ssSDS_md](../../includes/sssds-md.md)].<br /><br />`AS_TRANSACTION_ID_START`<br />`AS_TRANSACTION_ID_END`<br />`AS_SEQUENCE_NUMBER_START`<br />`AS_SEQUENCE_NUMBER_END`|
63
+
|`encryption_type`|**int**| Encryption type:<br /><br />`1` = Deterministic encryption<br />`2` = Randomized encryption<br /><br />**Applies to**: [!INCLUDE [sssql16-md](../../includes/sssql16-md.md)] and later versions, and [!INCLUDE [ssSDS_md](../../includes/sssds-md.md)]|
64
+
|`encryption_type_desc`|**nvarchar(64)**| Encryption type description:<br /><br />`RANDOMIZED`<br />`DETERMINISTIC`<br /><br />**Applies to**: [!INCLUDE [sssql16-md](../../includes/sssql16-md.md)] and later versions, and [!INCLUDE [ssSDS_md](../../includes/sssds-md.md)]|
65
+
|`encryption_algorithm_name`|**sysname**| Name of encryption algorithm. Only `AEAD_AES_256_CBC_HMAC_SHA_512` is supported.<br /><br />**Applies to**: [!INCLUDE [sssql16-md](../../includes/sssql16-md.md)] and later versions, and [!INCLUDE [ssSDS_md](../../includes/sssds-md.md)]|
66
+
|`column_encryption_key_id`|**int**| ID of the column encryption key (CEK).<br /><br />**Applies to**: [!INCLUDE [sssql16-md](../../includes/sssql16-md.md)] and later versions, and [!INCLUDE [ssSDS_md](../../includes/sssds-md.md)]|
67
+
|`column_encryption_key_database_name`|**sysname**| The name of the database where the column encryption key exists if different than the database of the column. `NULL` if the key exists in the same database as the column.<br /><br />**Applies to**: [!INCLUDE [sssql16-md](../../includes/sssql16-md.md)] and later versions, and [!INCLUDE [ssazuresynapse-md](../../includes/sssds-md.md)]|
68
+
|`is_hidden`|**bit**| Indicates if the column is hidden:<br /><br />`0` = regular, not-hidden, visible column<br />`1` = hidden column<br /><br />**Applies to**: [!INCLUDE [sssql16-md](../../includes/sssql16-md.md)] and later versions, and [!INCLUDE [ssSDS_md](../../includes/sssds-md.md)]|
69
+
|`is_masked`|**bit**| Indicates if the column is masked by dynamic data masking:<br /><br />`0` = regular, not-masked column<br />`1` = column is masked<br /><br />**Applies to**: [!INCLUDE [sssql16-md](../../includes/sssql16-md.md)] and later versions, and [!INCLUDE [ssSDS_md](../../includes/sssds-md.md)]|
70
+
|`graph_type`|**int**| Internal column with a set of values. The values are between `1` and `8` for graph columns, and `NULL` for others. |
|`is_data_deletion_filter_column`|**bit**| Indicates if the column is the data retention filter column for the table.<br /><br />**Applies to**: Azure SQL Edge |
73
+
|`ledger_view_column_type`|**int**| If not `NULL`, indicates the type of a column in a ledger view:<br /><br />`1` = `TRANSACTION_ID`<br />`2` = `SEQUENCE_NUMBER`<br />`3` = `OPERATION_TYPE`<br />`4` = `OPERATION_TYPE_DESC`<br /><br />For more information, see [Ledger overview](/azure/azure-sql/database/ledger-overview).<br /><br />**Applies to**: [!INCLUDE [sssql22-md](../../includes/sssql22-md.md)] and later versions, and [!INCLUDE [ssSDS_md](../../includes/sssds-md.md)]|
74
+
|`ledger_view_column_type_desc`|**nvarchar(60)**| If not `NULL`, contains a textual description of the the type of a column in a ledger view:<br /><br />`TRANSACTION_ID`<br />`SEQUENCE_NUMBER`<br />`OPERATION_TYPE`<br />`OPERATION_TYPE_DESC`<br /><br />**Applies to**: [!INCLUDE [sssql22-md](../../includes/sssql22-md.md)] and later versions, and [!INCLUDE [ssSDS_md](../../includes/sssds-md.md)]|
75
+
|`is_dropped_ledger_column`|**bit**| Indicates a ledger table column that was dropped.<br /><br />**Applies to**: [!INCLUDE [sssql22-md](../../includes/sssql22-md.md)] and later versions, and [!INCLUDE [ssSDS_md](../../includes/sssds-md.md)]|
[!INCLUDE [ssCatViewPerm](../../includes/sscatviewperm-md.md)] For more information, see [Metadata Visibility Configuration](../security/metadata-visibility-configuration.md).
0 commit comments