Wednesday, August 18, 2010

SQL Scripts for CLR Assemblies

Here are SQL Scripts for CLR assemblies on Microsoft SQL Server.

Assumptions: assembly's name: "SQLCLR.dll".In the dll, you have an aggregate function: "ConcateAll" which concatenate all string. The dll is in database server's c:\temp directory.

To enable CLR on SQL Server:

To clean up (remove the CLR function and assembly from database)

To upload assembly to SQL Server

Create aggregate function based on CLR assembly

Grant execution permission to user

No comments: