Using the CLR with C# DLLs

Microsoft’s Patrick Conlan explains how C# DLLs will work with the CLR in SQL Server 2005.

1 Min Read
ITPro Today logo in a gray background | ITPro Today

I understand that SQL Server 2005 is completely based on .NET Server and as such is integrated with Visual Studio .NET. Does this integration mean that I can use the CREATE ASSEMBLY command to register the DLLs I've created in C#? I also have an extended stored procedure that I created in Visual C++. Can I migrate this procedure, or do I have to create it again in C#?

Your existing extended stored procedures will continue to run as before. In addition, SQL Server 2005 integrates the .NET Framework Common Language Runtime (CLR) environment into its process space, which lets the SQL Server host programs that are written in .NET Framework languages. However, SQL Server itself is still essentially a large, unmanaged C and C++ program. You might need to make some small changes to move your C# code,ranging from altering your connect string to use the in-process SQLClient to adding metadata to complete rewrites. Before you try moving C# DLLs into SQL Server, you should perform due diligence to ensure that the move makes sense.You can get guidance for your decision from several white papers on the MSDN SQL Server site.You might start with the article "Using CLR Integration in SQL Server 2005" at http://msdn.microsoft.com/sql/default.aspx?pull=/library/en-us/dnsql90/html/sqlclrguidance.asp.

—Patrick Conlan
Platform Program Manager
Microsoft Project Team

Read more about:

Microsoft
Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like