Very short background: We use CLR stored procedures to apply access control using Active Directory in the query results to limit what the end user can see. In a nutshell, this is done by removing rows from the data where the user does not meet the criteria for accessing the result (the document in this case).
This filtering was previously done on the client before displaying the results. SQL 2008 and a much more powerful server are the motivation to migrate this access filtering from the client.
I am wondering if there is any performance advantage from calling the original T-SQL ordinary stored procedure from an equivalent CLR equivalent procedure, instead of having inline T-SQL passed to the comand object (which in this case is only the original T- SQL that was created by the stored procedure)? I can't find anywhere where anyone mentioned this (partly, probably because it would be very confusing as an example of CLR SP, I think :-)). It seems to me that you could, since the T-SQL stored process is already optimized and compiled?
Can anyone confirm this for me?
I hope I was clear enough. Thank you very much,
Colm
source share