Receiving SQL Server events from a CLR function
- by Pablo Lerner
I wrote a CLR class with several methods, which are linked as functions in a SQL Server 2005 database. When several of these functions are used in scope of one transaction or connection, I need another one to be automatically executed to clean up some stuff, at the time of transaction or connection close (either time is good for now, later I will decide which is best). I figure that receiving events from another new CLR functions can do, but I don't know how to achieve that.
Can anyone point me to information on modules, documents or whatever, that can help me understand how to receive transaction or connection closing events in a CLR class, or how to execute a particular function when these events occur?