|
1 | 1 | --- |
2 | 2 | title: "SQL_VARIANT_PROPERTY (Transact-SQL) | Microsoft Docs" |
3 | 3 | ms.custom: "" |
4 | | -ms.date: "09/12/2017" |
| 4 | +ms.date: "02/25/2020" |
5 | 5 | ms.prod: sql |
6 | 6 | ms.prod_service: "database-engine, sql-database, sql-data-warehouse, pdw" |
7 | 7 | ms.reviewer: "" |
@@ -42,9 +42,9 @@ SQL_VARIANT_PROPERTY ( expression , property ) |
42 | 42 |
|
43 | 43 | |Value|Description|Base type of sql_variant returned| |
44 | 44 | |-----------|-----------------|----------------------------------------| |
45 | | -|**BaseType**|[!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] data type, such as:<br /><br /> **bigint**<br /><br /> **binary**<br /><br /> **char**<br /><br /> **date**<br /><br /> **datetime**<br /><br /> **datetime2**<br /><br /> **datetimeoffset**<br /><br /> **decimal**<br /><br /> **float**<br /><br /> **int**<br /><br /> **money**<br /><br /> **nchar**<br /><br /> **numeric**<br /><br /> **nvarchar**<br /><br /> **real**<br /><br /> **smalldatetime**<br /><br /> **smallint**<br /><br /> **smallmoney**<br /><br /> **time**<br /><br /> **tinyint**<br /><br /> **uniqueidentifier**<br /><br /> **varbinary**<br /><br /> **varchar**|**sysname**<br /><br /> NULL = Input is not valid.| |
46 | | -|**Precision**|Number of digits of the numeric base data type:<br /><br /> **datetime** = 23<br /><br />**datetime2** = 27<br /><br /> **smalldatetime** = 16<br /><br /> **float** = 53<br /><br /> **real** = 24<br /><br /> **decimal** (p,s) and **numeric** (p,s) = p<br /><br /> **money** = 19<br /><br /> **smallmoney** = 10<br /><br /> **bigint** = 19<br /><br /> **int** = 10<br /><br /> **smallint** = 5<br /><br /> **tinyint** = 3<br /><br /> **bit** = 1<br /><br /> All other types = 0|**int**<br /><br /> NULL = Input is not valid.| |
47 | | -|**Scale**|Number of digits to the right of the decimal point of the numeric base data type:<br /><br /> **decimal** (p,s) and **numeric** (p,s) = s<br /><br /> **money** and **smallmoney** = 4<br /><br /> **datetime** = 3<br /><br />**datetime2** = 7<br /><br /> all other types = 0|**int**<br /><br /> NULL = Input is not valid.| |
| 45 | +|**BaseType**|[!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] data type, such as:<br /><br /> **bigint**<br /><br /> **binary**<br /><br /> **bit**<br /><br /> **char**<br /><br /> **date**<br /><br /> **datetime**<br /><br /> **datetime2**<br /><br /> **datetimeoffset**<br /><br /> **decimal**<br /><br /> **float**<br /><br /> **int**<br /><br /> **money**<br /><br /> **nchar**<br /><br /> **numeric**<br /><br /> **nvarchar**<br /><br /> **real**<br /><br /> **smalldatetime**<br /><br /> **smallint**<br /><br /> **smallmoney**<br /><br /> **time**<br /><br /> **tinyint**<br /><br /> **uniqueidentifier**<br /><br /> **varbinary**<br /><br /> **varchar**|**sysname**<br /><br /> NULL = Input is not valid.| |
| 46 | +|**Precision**|Number of digits of the numeric base data type:<br /><br /> **date** = 10<br /><br /> **datetime** = 23<br /><br /> **datetime2** = 27<br /><br /> **datetime2** (s) = 19 when s = 0, else s + 20<br /><br /> **datetimeoffset** = 34<br /><br /> **datetimeoffset** (s) = 26 when s = 0, else s + 27<br /><br /> **smalldatetime** = 16<br /><br /> **time** = 16<br /><br /> **time** (s) = 8 when s = 0, else s + 9<br /><br /> **float** = 53<br /><br /> **real** = 24<br /><br /> **decimal** and **numeric** = 18<br /><br /> **decimal** (p,s) and **numeric** (p,s) = p<br /><br /> **money** = 19<br /><br /> **smallmoney** = 10<br /><br /> **bigint** = 19<br /><br /> **int** = 10<br /><br /> **smallint** = 5<br /><br /> **tinyint** = 3<br /><br /> **bit** = 1<br /><br /> All other types = 0|**int**<br /><br /> NULL = Input is not valid.| |
| 47 | +|**Scale**|Number of digits to the right of the decimal point of the numeric base data type:<br /><br /> **decimal** and **numeric** = 0<br /><br /> **decimal** (p,s) and **numeric** (p,s) = s<br /><br /> **money** and **smallmoney** = 4<br /><br /> **datetime** = 3<br /><br /> **datetime2** = 7<br /><br /> **datetime2** (s) = s (0 - 7)<br /><br /> **datetimeoffset** = 7<br /><br /> **datetimeoffset** (s) = s (0 - 7)<br /><br /> **time** = 7<br /><br /> **time** (s) = s (0 - 7)<br /><br /> all other types = 0|**int**<br /><br /> NULL = Input is not valid.| |
48 | 48 | |**TotalBytes**|Number of bytes required to hold both the metadata and data of the value. This information would be useful in checking the maximum side of data in a **sql_variant** column. If the value is larger than 900, index creation fails.|**int**<br /><br /> NULL = Input is not valid.| |
49 | 49 | |**Collation**|Represents the collation of the particular **sql_variant** value.|**sysname**<br /><br /> NULL = Input is not valid.| |
50 | 50 | |**MaxLength**|Maximum data type length, in bytes. For example, **MaxLength** of **nvarchar(**50**)** is 100, **MaxLength** of **int** is 4.|**int**<br /><br /> NULL = Input is not valid.| |
|
0 commit comments