tag:blogger.com,1999:blog-21895954.post5657696739226174818..comments2023-10-11T01:39:25.473-07:00Comments on Andrus Development: SQL CLR Aggregate: MedianWilliam Andrushttp://www.blogger.com/profile/03485818134703783587noreply@blogger.comBlogger11125tag:blogger.com,1999:blog-21895954.post-72711876160949179422018-05-23T09:30:45.549-07:002018-05-23T09:30:45.549-07:00Hey andrus,
great post. Helped me a lot. Thanks a ...Hey andrus,<br />great post. Helped me a lot. Thanks a ton.Anonymoushttps://www.blogger.com/profile/16732820316215399490noreply@blogger.comtag:blogger.com,1999:blog-21895954.post-9424424517743582832013-07-29T13:17:41.051-07:002013-07-29T13:17:41.051-07:00Jason,
It's okay.Jason,<br /><br />It's okay.William Andrushttps://www.blogger.com/profile/03485818134703783587noreply@blogger.comtag:blogger.com,1999:blog-21895954.post-14935555760889545242013-07-29T13:15:09.251-07:002013-07-29T13:15:09.251-07:00Just to clarify it is a closed source / for profit...Just to clarify it is a closed source / for profit project. Still ok? Thanks for getting back to me so quick.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-21895954.post-56864944886128818242013-07-29T13:14:13.958-07:002013-07-29T13:14:13.958-07:00This comment has been removed by the author.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-21895954.post-82683090604400958752013-07-29T12:32:18.127-07:002013-07-29T12:32:18.127-07:00If need be, you can grab the code also here: https...If need be, you can grab the code also here: https://github.com/andrusw/SQLCLR-Library/blob/master/SQLCLR/Math/Median/Median.csWilliam Andrushttps://www.blogger.com/profile/03485818134703783587noreply@blogger.comtag:blogger.com,1999:blog-21895954.post-24208910200296704942013-07-29T12:26:07.644-07:002013-07-29T12:26:07.644-07:00It's all open and free to use. Nothing proprie...It's all open and free to use. Nothing propriety here.William Andrushttps://www.blogger.com/profile/03485818134703783587noreply@blogger.comtag:blogger.com,1999:blog-21895954.post-46740177945873450992013-07-29T12:19:43.928-07:002013-07-29T12:19:43.928-07:00I need to implement a clr aggregate median in a pr...I need to implement a clr aggregate median in a project that I am working on, but it doesn't say anything about the legal use of code on your site. Can you send me any licensing restrictions you have on the code that you post on the blog?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-21895954.post-38234052368984735922012-05-07T11:01:48.831-07:002012-05-07T11:01:48.831-07:00I see, the Invariants are used by sql-server query...I see, the Invariants are used by sql-server query processor to determine the most optimized query execution plan/path. <br /><br />My execution, doesn't care about the order, so setting it to true -- might actually make it run quicker.William Andrushttps://www.blogger.com/profile/03485818134703783587noreply@blogger.comtag:blogger.com,1999:blog-21895954.post-55161610746810368672012-05-05T08:43:21.353-07:002012-05-05T08:43:21.353-07:00I believe you're misunderstanding the invarian...I believe you're misunderstanding the invariant flags. IsInvariantToOrder means that it doesnt matter what order the incoming data is in, it will be yield the same result. This allows the optimizer to ignore any order by statement within that aggregate.<br />A concatenate aggregate would NOT be order invariant, but a sum, avg, and your implementation of median ARE order invariant.<br /><br />Thanks for the post!Anonymoushttps://www.blogger.com/profile/00212117083196650946noreply@blogger.comtag:blogger.com,1999:blog-21895954.post-58243322037529359442012-01-25T07:45:25.999-08:002012-01-25T07:45:25.999-08:00I don't have that problem. I did up to 6 dbo.M...I don't have that problem. I did up to 6 dbo.Median calls at the same time before stopping. I did notice that I still have a buffer issue. <br /><br />I originally had the attribute set at MaxByteSize = 8000, then I changed it to MaxByteSize = -1 which worked for more. I think anything over 1000+ seems to give me a buffer error. (Assuming I deployed my changes to my dev environment)William Andrushttps://www.blogger.com/profile/03485818134703783587noreply@blogger.comtag:blogger.com,1999:blog-21895954.post-17210706136540356452012-01-25T07:19:17.347-08:002012-01-25T07:19:17.347-08:00Tanks for solution but if 2 user call the median f...Tanks for solution but if 2 user call the median function at same time the median function throw System.NullReferenceException.<br /><br />For reproduce the bug :<br />select<br />(select dbo.median(field1) from table),(select dbo.median(field2) from table)Anonymousnoreply@blogger.com