Comparing SQL_VARIANTs : SQL_VARIANT « Data Types « SQL Server / T-SQL Tutorial






4> IF CAST(12.0 AS SQL_VARIANT) > CAST(10E AS SQL_VARIANT)
5>   PRINT 'Bigger'
6> ELSE
7>   PRINT 'Smaller';
8> GO
Smaller








5.22.SQL_VARIANT
5.22.1.sql_variant data type is designed to allow a single variable, column, or parameter to store values in different data types.
5.22.2.The creation of the table, with a column of the SQL_VARIANT type.
5.22.3.Insert different type of values into a sql_variant column
5.22.4.sql_variant type column
5.22.5.Select case and cast SQL_VARIANT
5.22.6.Comparing SQL_VARIANTs