I’m just playing around a bit with CLR-Assemblies on a SQL2008 server. My first thought was: “Great, now I don’t need to add 25 stored procedures and functions to get my main stored procedure readable. I just create one DLL and add all I need in it.”
So I just tried a simple HelloWorld example from the MSDN and as an example how to call it I get:
CREATE PROCEDURE hello
AS
EXTERNAL NAME HelloWorld.Procedures.HelloWorld
Is this the only way to call a function in a CLR-Assembly? I want to call it without creating a single stored procedure for every function in my class. Possible?
Simple answer, no! Every CLR stored procedure and stored function needs a T-SQL stored procedure or stored function defintion with the appropriate external name.