TYPE_ID

Returns the ID for a specified data type name.

Syntax

TYPE_ID ( [ 'schema_name'. ] 'type_name' )

Arguments

schema_name

Is the name of the schema where the type_name belongs.

type_name

Is the name of the data type. type_name is of type nvarchar. type_name can be a system data type.

Return types

nvarchar

Example

SELECT TYPE_ID('sys.char') AS [2 Part Data Type ID];

See Also