CLR SQL Server 2005 procedure to take stored procedure results as a parameter
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.
精彩评论