Oct
17
Written by:
Peter Henry
Friday, October 17, 2008 9:56 AM
http://msdn.microsoft.com/en-us/library/ms131092.aspx
Here's a quick chart.
|
SQL Server data type
|
CLR data type (SQL Server)
|
CLR data type (.NET Framework)
|
|
binary
|
SqlBytes, SqlBinary
|
Byte[]
|
|
bit
|
SqlBoolean
|
Boolean, Nullable
|
|
char
|
None
|
None
|
|
date
|
SqlDateTime
|
DateTime, Nullable
|
|
datetime
|
SqlDateTime
|
DateTime, Nullable
|
|
decimal
|
SqlDecimal
|
Decimal, Nullable
|
|
float
|
SqlDouble
|
Double, Nullable
|
|
int
|
SqlInt32
|
Int32, Nullable
|
|
money
|
SqlMoney
|
Decimal, Nullable
|
|
nchar
|
SqlChars, SqlString
|
String, Char[]
|
|
ntext
|
None
|
None
|
|
numeric
|
SqlDecimal
|
Decimal, Nullable
|
|
nvarchar
|
SqlChars, SqlString
SQLChars is a better match for data transfer and access, and SQLString is a better match for performing String operations.
|
String, Char[]
|
|
text
|
None
|
None
|
|
time
|
TimeSpan
|
TimeSpan, Nullable
|
|
timestamp
|
None
|
None
|
|
tinyint
|
SqlByte
|
Byte, Nullable
|
|
uniqueidentifier
|
SqlGuid
|
Guid, Nullable
|
|
User-defined type(UDT)
|
None
|
The same class that is bound to the user-defined type in the same assembly or a dependent assembly.
|
|
varchar
|
None
|
None
|
|
xml
|
SqlXml
|
None
|
Tags: