Skip to content

Latest commit

 

History

History
60 lines (53 loc) · 4.01 KB

File metadata and controls

60 lines (53 loc) · 4.01 KB
title sys.systypes (Transact-SQL)
description sys.systypes (Transact-SQL)
author rwestMSFT
ms.author randolphwest
ms.date 03/15/2017
ms.service sql
ms.subservice system-objects
ms.topic reference
ms.custom
ignite-2025
f1_keywords
sys.systypes_TSQL
systypes_TSQL
sys.systypes
systypes
helpviewer_keywords
sys.systypes compatibility view
systypes system table
dev_langs
TSQL
monikerRange >=aps-pdw-2016 || =azuresqldb-current || =azure-sqldw-latest || >=sql-server-2016 || >=sql-server-linux-2017 || =azuresqldb-mi-current || =fabric || =fabric-sqldb

sys.systypes (Transact-SQL)

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

Returns one row for each system-supplied and each user-defined data type defined in the database.

Important

[!INCLUDEssnoteCompView]

Column name Data type Description
name sysname Data type name.
xtype tinyint Physical storage type.
status tinyint [!INCLUDEssInternalOnly]
xusertype smallint Extended user type. Overflows or returns NULL if the number of data types exceeds 32,767.
length smallint Physical length of the data type.
xprec tinyint Internal precision, as used by the server. Not to be used in queries.
xscale tinyint Internal scale, as used by the server. Not to be used in queries.
tdefault int ID of the stored procedure that contains integrity checks for this data type.
domain int ID of the stored procedure that contains integrity checks for this data type.
uid smallint Schema ID of the owner of the type.

For databases upgraded from an earlier version of [!INCLUDEssNoVersion], the schema ID is equal to the user ID of the owner.

** Important ** If you use any of the following [!INCLUDEssNoVersion] DDL statements, you must use the sys.types catalog view instead of sys.systypes.

ALTER AUTHORIZATION ON TYPE

CREATE TYPE

Overflows or returns NULL if the number of users and roles exceeds 32,767.
reserved smallint [!INCLUDEssInternalOnly]
collationid int If character based, collationid is the id of the collation of the current database; otherwise, it is NULL.
usertype smallint User type ID. Overflows or returns NULL if the number of data types exceeds 32,767.
variable bit Variable-length data type.

1 = True

0 = False
allownulls bit Indicates the default nullability for this data type. This default value is overridden by if nullability is specified by using CREATE TABLE or ALTER TABLE.
type tinyint Physical storage data type.
printfmt varchar(255) [!INCLUDEssInternalOnly]
prec smallint Level of precision for this data type.

-1 = xml or large value types.
scale tinyint Scale for this data type, based on precision.

NULL = Data type is nonnumeric.
collation sysname If character based, collation is the collation of the current database; otherwise, it is NULL.

See Also

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