CXVariantPerformConvert::Convert

DLL: sqlTsEs.dll

Class: CXVariantPerformConvert<Type1, Type2>

Section: Types

Description: There is a group of classes (probably c++ templates) which take two types and convert from one to another, these are called when the sql CAST is used – some conversions like smallint to int happen without calling these functions. The full list of types is:

CXVariantPerformConvert<108,104>::Convert
CXVariantPerformConvert<108,48>::Convert
CXVariantPerformConvert<108,52>::Convert
CXVariantPerformConvert<122,127>::Convert
CXVariantPerformConvert<122,48>::Convert
CXVariantPerformConvert<122,52>::Convert
CXVariantPerformConvert<122,56>::Convert
CXVariantPerformConvert<127,104>::Convert
CXVariantPerformConvert<127,122>::Convert
CXVariantPerformConvert<127,48>::Convert
CXVariantPerformConvert<127,52>::Convert
CXVariantPerformConvert<127,56>::Convert
CXVariantPerformConvert<127,60>::Convert
CXVariantPerformConvert<127,62>::Convert
CXVariantPerformConvert<165,104>::Convert
CXVariantPerformConvert<165,36>::Convert
CXVariantPerformConvert<165,48>::Convert
CXVariantPerformConvert<165,52>::Convert
CXVariantPerformConvert<167,104>::Convert
CXVariantPerformConvert<167,127>::Convert
CXVariantPerformConvert<167,48>::Convert
CXVariantPerformConvert<167,52>::Convert
CXVariantPerformConvert<167,56>::Convert
CXVariantPerformConvert<189,52>::Convert
CXVariantPerformConvert<189,56>::Convert
CXVariantPerformConvert<189,60>::Convert
CXVariantPerformConvert<231,104>::Convert
CXVariantPerformConvert<231,48>::Convert
CXVariantPerformConvert<231,52>::Convert
CXVariantPerformConvert<231,56>::Convert
CXVariantPerformConvert<231,62>::Convert
CXVariantPerformConvert<40,58>::Convert
CXVariantPerformConvert<40,61>::Convert
CXVariantPerformConvert<48,127>::Convert
CXVariantPerformConvert<48,62>::Convert
CXVariantPerformConvert<52,127>::Convert
CXVariantPerformConvert<52,48>::Convert
CXVariantPerformConvert<52,62>::Convert
CXVariantPerformConvert<56,127>::Convert
CXVariantPerformConvert<56,48>::Convert
CXVariantPerformConvert<56,52>::Convert
CXVariantPerformConvert<56,62>::Convert
CXVariantPerformConvert<58,104>::Convert
CXVariantPerformConvert<58,127>::Convert
CXVariantPerformConvert<58,40>::Convert
CXVariantPerformConvert<58,48>::Convert
CXVariantPerformConvert<58,52>::Convert
CXVariantPerformConvert<58,56>::Convert
CXVariantPerformConvert<58,59>::Convert
CXVariantPerformConvert<58,62>::Convert
CXVariantPerformConvert<59,104>::Convert
CXVariantPerformConvert<59,127>::Convert
CXVariantPerformConvert<59,48>::Convert
CXVariantPerformConvert<59,52>::Convert
CXVariantPerformConvert<59,60>::Convert
CXVariantPerformConvert<59,62>::Convert
CXVariantPerformConvert<60,104>::Convert
CXVariantPerformConvert<60,48>::Convert
CXVariantPerformConvert<60,52>::Convert
CXVariantPerformConvert<61,104>::Convert
CXVariantPerformConvert<61,127>::Convert
CXVariantPerformConvert<61,40>::Convert
CXVariantPerformConvert<61,48>::Convert
CXVariantPerformConvert<61,52>::Convert
CXVariantPerformConvert<62,104>::Convert
CXVariantPerformConvert<62,122>::Convert
CXVariantPerformConvert<62,127>::Convert
CXVariantPerformConvert<62,48>::Convert
CXVariantPerformConvert<62,52>::Convert
CXVariantPerformConvert<62,56>::Convert
CXVariantPerformConvert<62,59>::Convert
CXVariantPerformConvert<62,60>::Convert
CXvariantPerformConvertFromBHToBH::Convert
CXVariantPerformConvertFromBHToString<165,167,0>::Convert
CXVariantPerformConvertFromBHToString<165,231,0>::Convert
CXVariantPerformConvertFromBHToString<167,165,0>::Convert
CXVariantPerformConvertFromBHToString<231,165,0>::Convert
CXVariantPerformConvertFromBHToString<231,231,1>::Convert
CXVariantPerformConvertFromUdtToBinary
CXVariantPerformConvertToByt<127>::Convert
CXVariantPerformConvertToByt<165>::Convert
CXVariantPerformConvertToByt<34>::Convert
CXVariantPerformConvertToByt<48>::Convert
CXVariantPerformConvertToByt<52>::Convert
CXVariantPerformConvertToByt<62>::Convert
CXVariantPerformConvertToDate<127,58>::Convert
CXVariantPerformConvertToDate<127,61>::Convert
CXVariantPerformConvertToDate<165,58>::Convert
CXVariantPerformConvertToDate<167,58>::Convert
CXVariantPerformConvertToDate<167,61>::Convert
CXVariantPerformConvertToDate<189,58>::Convert
CXVariantPerformConvertToDate<189,61>::Convert
CXVariantPerformConvertToDate<231,61>::Convert
CXVariantPerformConvertToDate<52,58>::Convert
CXVariantPerformConvertToDate<56,58>::Convert
CXVariantPerformConvertToDate<56,61>::Convert
CXVariantPerformConvertToDate<59,58>::Convert
CXVariantPerformConvertToDate<62,58>::Convert
CXVariantPerformConvertToDate<62,61>::Convert
CXVariantPerformConvertToNm<122>::Convert
CXVariantPerformConvertToNm<127>::Convert
CXVariantPerformConvertToNm<231>::Convert
CXVariantPerformConvertToNm<59>::Convert
CXVariantPerformConvertToNm<62>::Convert
CXVariantPerformConvertToSsVariant<104>::Convert
CXVariantPerformConvertToSsVariant<106>::Convert
CXVariantPerformConvertToSsVariant<108>::Convert
CXVariantPerformConvertToSsVariant<122>::Convert
CXVariantPerformConvertToSsVariant<127>::Convert
CXVariantPerformConvertToSsVariant<165>::Convert
CXVariantPerformConvertToSsVariant<167>::Convert
CXVariantPerformConvertToSsVariant<231>::Convert
CXVariantPerformConvertToSsVariant<36>::Convert
CXVariantPerformConvertToSsVariant<40>::Convert
CXVariantPerformConvertToSsVariant<48>::Convert
CXVariantPerformConvertToSsVariant<52>::Convert
CXVariantPerformConvertToSsVariant<56>::Convert
CXVariantPerformConvertToSsVariant<58>::Convert
CXVariantPerformConvertToSsVariant<59>::Convert
CXVariantPerformConvertToSsVariant<60>::Convert
CXVariantPerformConvertToSsVariant<61>::Convert
CXVariantPerformConvertToSsVariant<62>::Convert
CXVariantPerformConvertToStr<127>::Convert
CXVariantPerformConvertToStr<165>::Convert
CXVariantPerformConvertToStr<167>::Convert
CXVariantPerformConvertToStr<34>::Convert
CXVariantPerformConvertToStr<35>::Convert
CXVariantPerformConvertToStr<40>::Convert
CXVariantPerformConvertToStr<58>::Convert
CXVariantPerformConvertToStr<60>::Convert
CXVariantPerformConvertToStr<61>::Convert
CXVariantPerformConvertToStr<62>::Convert
CXVariantPerformConvertToWstr<127,0>::Convert
CXVariantPerformConvertToWstr<165,0>::Convert
CXVariantPerformConvertToWstr<231,0>::Convert
CXVariantPerformConvertToWstr<231,1>::Convert
CXVariantPerformConvertToWstr<34,0>::Convert
CXVariantPerformConvertToWstr<40,0>::Convert
CXVariantPerformConvertToWstr<58,0>::Convert
CXVariantPerformConvertToWstr<61,0>::Convert
CXVariantPerformConvertToWstr<62,0>::Convert
CXVariantPerformConvertToWstr<99,0>::Convert
CXVariantPerformConvertVarTime<40,42>::Convert
CXVariantPerformConvertVarTime<40,43>::Convert
CXVariantPerformConvertVarTime<41,41>::Convert
CXVariantPerformConvertVarTime<41,42>::Convert
CXVariantPerformConvertVarTime<41,43>::Convert
CXVariantPerformConvertVarTime<41,58>::Convert
CXVariantPerformConvertVarTime<41,61>::Convert
CXVariantPerformConvertVarTime<42,40>::Convert
CXVariantPerformConvertVarTime<42,41>::Convert
CXVariantPerformConvertVarTime<42,42>::Convert
CXVariantPerformConvertVarTime<42,43>::Convert
CXVariantPerformConvertVarTime<42,58>::Convert
CXVariantPerformConvertVarTime<42,61>::Convert
CXVariantPerformConvertVarTime<43,40>::Convert
CXVariantPerformConvertVarTime<43,41>::Convert
CXVariantPerformConvertVarTime<43,42>::Convert
CXVariantPerformConvertVarTime<43,43>::Convert
CXVariantPerformConvertVarTime<43,58>::Convert
CXVariantPerformConvertVarTime<43,61>::Convert
CXVariantPerformConvertVarTime<58,41>::Convert
CXVariantPerformConvertVarTime<58,42>::Convert
CXVariantPerformConvertVarTime<58,43>::Convert
CXVariantPerformConvertVarTime<61,41>::Convert
CXVariantPerformConvertVarTime<61,42>::Convert
CXVariantPerformConvertVarTime<61,43>::Convert
CXVariantPerformConvertWithFullTi<40,62>::Convert
CXVariantPerformConvertWithFullTi<41,62>::Convert
CXVariantPerformConvertWithFullTi<42,62>::Convert
CXVariantPerformConvertWithFullTi<43,62>::Convert
CXVariantPerformConvertWithFullTi<62,40>::Convert
CXVariantPerformConvertWithFullTi<62,41>::Convert
CXVariantPerformConvertWithFullTi<62,42>::Convert
CXVariantPerformConvertWithFullTi<62,43>::Convert

I don’t know what he type numbers match up to, will try to figure it out, it should be fairly simple by issuing a query like SELECT CAST(@int as bigint) and seeing what function it hits but that is slow and painful as there are loads of them!

Update:

Some of the types:

56 int

127 bigint

62 float

Update 2:

The types match up to the types in the [ms-tds] spec so:

 

NULLTYPE  0x1F  Null
INT1TYPE  0x30  TinyInt
BITTYPE  0x32  Bit
INT2TYPE  0x34  SmallInt
INT4TYPE  0x38  Int
DATETIM4TYPE  0x3A  SmallDateTime
FLT4TYPE  0x3B  Real
MONEYTYPE  0x3C  Money
DATETIMETYPE  0x3D  DateTime
FLT8TYPE  0x3E  Float
MONEY4TYPE  0x7A  SmallMoney
INT8TYPE  0x7F  BigInt
GUIDTYPE  0x24  UniqueIdentifier
INTNTYPE  0x26  (see below)
DECIMALTYPE  0x37  Decimal (legacy support)
NUMERICTYPE  0x3F  Numeric (legacy support)
BITNTYPE  0x68  (see below)
DECIMALNTYPE  0x6A  Decimal
NUMERICNTYPE  0x6C  Numeric
FLTNTYPE  0x6D  (see below)
MONEYNTYPE  0x6E  (see below)
DATETIMNTYPE  0x6F  (see below)
DATENTYPE  0x28  (introduced in TDS 7.3)
TIMENTYPE  0x29  (introduced in TDS 7.3)
DATETIME2NTYPE  0x2A  (introduced in TDS 7.3)
DATETIMEOFFSETNTYPE  0x2B  (introduced in TDS 7.3)
CHARTYPE  0x2F  Char (legacy support)
VARCHARTYPE  0x27  VarChar (legacy support)
BINARYTYPE  0x2D  Binary (legacy support)
VARBINARYTYPE  0x25  VarBinary (legacy support)
BIGVARBINTYPE  0xA5  VarBinary
BIGVARCHRTYPE  0xA7  VarChar
BIGBINARYTYPE  0xAD  Binary
BIGCHARTYPE  0xAF  Char
NVARCHARTYPE  0xE7  NVarChar
NCHARTYPE  0xEF  NChar
XMLTYPE  0xF1  XML (introduced in TDS 7.2)
UDTTYPE  0xF0  CLR-UDT (introduced in TDS 7.2)
TEXTTYPE  0x23  Text
IMAGETYPE  0x22  Image
NTEXTTYPE  0x63  NText
SSVARIANTTYPE  0x62  Sql_Variant (introduced in TDS 7.2)

 

To help confirm this list, I used the “SQL Server Data Type Conversion Chart” from http://www.microsoft.com/en-us/download/details.aspx?id=35834 and they do indeed match.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s