Wednesday, March 28, 2012

Multi parameter aggregate CLR-function?

In the provided CLR-function sample there is only one parameter from the SQL statement to the function. I can't find any info about how to pass more then one parameter. Is this possible somehow?

like:

Code Snippet

Select ShopCode,PickAValue(OrderDate,Article) as BestArticle

from T_Sales

Group by ShopCode

hans

I was looking at something similar recently and came across this post:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=789719&SiteID=1

It looks like you can only have one parameter in a UDA though the XML work around mentioned may be suitable (I've not tried it, mind).


HTH.

|||

Yes I have found a similar solution, by concatenating the values with a TAB as seperator, this looks like the XML variant, eg putting the values of all needed paramteres in a single string value.

hans

|||

There is a post on the .NET Framework inside SQL Server Katmai forum that says there is a strong possibility multi-input aggregates will be supported in Katmai:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1703860&SiteID=1

No comments:

Post a Comment