I cannot properly call the T-SQL stored procedure ...
I don’t know what logic needs to be kept inside your CLR component, however you can, of course, call stored procedures from the CLR component to get the data you want to process. You can also call stored procedures to update data after you have processed it.
It was drilled in me that hardcoding SQL statements in .NET. The source code of an application is evil. Is the CLR stored procedure an exception to this rule?
There are many reasons not to put hard-coded SQL statements in compiled code and use stored procedures instead. We could easily list and discuss the arguments behind this, but I suggest that if you have this rule, then yes, this also applies to the CLR. If only for any reason to be consistent.
source
share