Skip to content

Latest commit

 

History

History
57 lines (51 loc) · 3.93 KB

sys-systypes-transact-sql.md

File metadata and controls

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

sys.systypes (Transact-SQL)

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

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)