Srinivas Sampath

from t in myThoughts where myThoughts.Thoughts = "Technology" select t

Auto Register Objects During Create Assembly

Normally, when we create CLR objects for SQL Server 2005, you would first execute a CREATE ASSEMBLY to catalog the assembly in the database. Then, depending on what you are writing, you may map procedures, functions etc to the CLR entry points. If, on the other hand, you are using Visual Studio, when you choose the “Deploy” method, VS does the entire thing for you. However, for production class systems, you would not want VS to automatically deploy to those systems and you may rather resort to the manual CREATE ASSEMBLY method. In this case, after registering the assembly, manually mapping the various objects can be a lot of typing. Fortunately, the CLR team has put in a small piece of code, that acts like a trigger on the CREATE ASSEMBLY statement and then using Reflection, automatically registers the various objects found in the assembly as procedures, triggers etc. You can view the code here: CLR Trigger for Automatic Registration of UDXs on CREATE ASSEMBLY.
Leave a Comment

(required) 

(required) 

(optional)

(required)