Can a sql server aggregate udf be passed in multiple parameters?
I am trying to write an aggregate udf for using Sql Server 2008 and C# 3.5 that implodes an aggregation of data. The kind of syntax I am looking for is:
开发者_开发百科SELECT [dbo].[Implode]([Id], ',') FROM [dbo].[Table] GROUP BY [ForeignID]
where the second parameter is the delimiter for the aggregate function. And example return value would be something like:
1,4,56
Is there a way to have multiple parameters in an aggregate udf?
In SQL 2008 Yes. For an example of one very similar to what you are doing I think see the post here CLR: Multi Param Aggregate, Argument not in Final Output?
精彩评论