I have a stored procedure that returns a rowset that I'd like to pass into a CLR stored procedure to do some advanced calculations.
How would I set this up? Take the input? Iterate the rowset within the CLR procedure?
I have a stored procedure that returns a rowset that I'd like to pass into a CLR stored procedure to do some advanced calculations.
How would I set this up? Take the input? Iterate the rowset within the CLR procedure?
The best would be to have the CLR procedure execute the stored procedure itself, with an ordinary SqlCommand and iterate over the result as an ordinary SqlDataReader. This is the best way, since you avoid the extra copy of the result.
Another option would be to set up a SQLCLR Aggregate function. Depending on the structure of your formula, this might be a more natural syntax.