What SQL Server data types map to what .NET data types

When writing CLR objects you have to write the .NET code which is compiled into an assembly that you register in SQL Server using the CREATE ASSEMBLY statement. You then need to create the SQL object that references the method in the assembly.

When creating the SQL object and the .NET method you need to specify what data types you want to use for any parameters or return types. SQL Server and .NET use a different set of data types but there is a correlation between the two what can be found in the following link. There are some SQL Server data types that do not have corresponding types in .NET such as the TABLE type.

NB. This link is for version 3.5 of the framework which is supported by SQL Server 2008 and above.



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