TYPEPROPERTY()
Returns information about a data type.
Signature
TYPEPROPERTY (type , property)Parameters
- type — Is the name of the data type.
- property — Is the type of information to be returned for the data type. *property* can be one of the following values.
Examples
SELECT TYPEPROPERTY(SCHEMA_NAME(schema_id) + '.' + name, 'OwnerId') AS owner_id, name, system_type_id, user_type_id, schema_id
FROM sys.types;4|image|34|34|4
4|text|35|35|4
4|uniqueidentifier|36|36|4
4|date|40|40|4
4|time|41|41|4
4|datetime2|42|42|4
4|datetimeoffset|43|43|4
4|tinyint|48|48|4
4|smallint|52|52|4
4|int|56|56|4
4|smalldatetime|58|58|4
4|real|59|59|4
4|money|60|60|4
4|datetime|61|61|4
4|float|62|62|4
4|sql_variant|98|98|4
4|ntext|99|99|4
4|bit|104|104|4
4|decimal|106|106|4
4|numeric|108|108|4
4|smallmoney|122|122|4
4|bigint|127|127|4
4|hierarchyid|240|128|4
4|geometry|240|129|4
4|geography|240|130|4
4|varbinary|165|165|4
4|varchar|167|167|4
4|binary|173|173|4
4|char|175|175|4
4|timestamp|189|189|4
4|nvarchar|231|231|4
4|nchar|239|239|4
4|xml|241|241|4
4|sysname|231|256|4SELECT TYPEPROPERTY( 'tinyint', 'PRECISION');3Run against SQL Server 16.0.4265.3 on 2026-09-13. This is the output we got, not the documentation’s.
Available on
- SQL Server 2017 and later
- Azure SQL Database
- Azure SQL Managed Instance
- Azure Synapse Analytics
- Analytics Platform System (PDW)
- Fabric SQL database
Want to run this against your own SQL Server server from an iPhone, iPad or Mac? These are ours — every connection goes straight from the device to your database, with no account and no server of ours in between.
Signature and description adapted from the Microsoft SQL documentation, used under the CC BY 4.0. SQL Server and Azure are trademarks of the Microsoft group of companies. This page is not affiliated with Microsoft.