The namespace provides classes for native data types in ssNoVersion. These classes provide a safer, faster alternative to the data types provided by the .NET Framework common language runtime (CLR). Using the classes in this namespace helps prevent type conversion errors caused by loss of precision. Because other data types are converted to and from SqlTypes behind the scenes, explicitly creating and using objects within this namespace also yields faster code.

Each data type in SqlTypes has its equivalent data type in SQL Server, with the same underlying data representation. Many of them also have equivalent data types in the CLR. However, SqlDateTime, SqlDecimal, and SqlString have different underlying data structures with their corresponding .NET Framework data types.

The following table maps the members of the SqlTypes namespace to Microsoft ssNoVersion data types and to the members of the enumeration.

.NET Framework SqlTypes

Native ssNoVersion

.NET Framework SqlDbType

binary, image, timestamp, varbinary

Binary, Image, TimeStamp, VarBinary

bit

Bit

tinyint

TinyInt

binary, image, timestamp, varbinary

Binary, Image, TimeStamp, VarBinary

char, nchar, text, ntext, nvarchar, varchar

Char, NChar, Text, Ntext, NVarChar, VarChar

datetime, smalldatetime

DateTime, SmallDateTime

numeric, decimal

Decimal

float

Float

varbinary

VarBinary

uniqueidentifier

UniqueIdentifier

smallint

SmallInt

int

Int

bigint

BigInt

money, smallmoney

Money, SmallMoney

real

Real

char, nchar, text, ntext, nvarchar, varchar

Char, NChar, Text, Ntext, NVarChar, VarChar

xml

Xml