We all know how great T-SQL is for database code, but writing procedural code in T-SQL has always been difficult. It seems impossible when we need a stored procedure or two, requiring some array-operations, text-parsing or complex math operations. However, it is quite easy if our Server allows us to deploy C# or VB.NET code that is used within the Server process. In other words, if we need complex procedural code, we can write it as managed code.
With the Common Language Runtime (CLR) hosted in Microsoft SQL Server 2005(called CLR integration), we can write stored procedures, triggers, user- defined functions, user-defined types, and user-defined aggregates in managed code. Because managed code compiles to native code prior to execution, we can achieve significant performance increases in some scenarios. Thus SQL Server essentially acts as the operating system for the CLR when it is hosted inside SQL Server....
Please visit for more details : http://aspalliance.com/1081