Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom aggregation functions in SQL Server vs Aggregate in Linq

I'm topically aware, but not well versed, in the ways that one can write a custom aggregation function for SQL Server in the CLR. I am also just getting into learning LINQ and I am intrigued by the Aggregate function. It seems to me that if one had access to LINQ then writing their own custom aggregate function with SQL Server is unncessary. Is this true? If not, are there any non-fringe cases where one would need to write a custom aggregate function with SQL Server vs using the Aggregate method provided by LINQ?

like image 612
wootscootinboogie Avatar asked Jun 01 '26 02:06

wootscootinboogie


1 Answers

I don't know if this counts as a fringe case, but any place where it's feasible to get a feed from a database and not feasible to filter it through LINQ is a potential case.

Some I thought of: SSRS reports, SSIS feeds to someplace else, any place where you're making business-logic decisions in a stored procedure (which you quite arguably shouldn't, but people do.)

like image 142
Ann L. Avatar answered Jun 02 '26 15:06

Ann L.