Search
Wednesday, January 07, 2009 ..:: Home ::.. Register  Login
   Calendar  
     
  
   Search  
     
  
   Blogroll  
     
  
   Disclosure  
All blog entries are the opinions of the author and do not necessarily reflect the opinions of their employer. All the code presented is for explanation and demonstration purposes only. Any damages incurred to your site and/or data are not the responsibility of the author. Every effort is taken to ensure the code properly compiles, however sometimes there are some hiccups and you might be required to do your own debugging.
     
  
   TechTidBits (Blog)  
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:

Your name:
Title:
Comment:
Add Comment    Cancel  
     
  
Copyright 1999-2008 by PCHenry.com   Terms Of Use  Privacy Statement