Question

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?

Was it helpful?

Solution

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.

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top