views:

26

answers:

2

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?

+1  A: 

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.

Remus Rusanu
A: 

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.

Paul Keister