Skip to content

Instantly share code, notes, and snippets.

@jalgaba
jalgaba / Aggregate_Concatenate.sql
Last active January 24, 2019 19:06 — forked from FilipDeVos/Aggregate_Concatenate.sql
SQL Server Aggregate to concatenate DISTINCT strings
-- This script deploys the dbo.ConcatDistinct() aggregate function on SQL Server. This is compiled from the code ConcatDistinct.cs below.
CREATE ASSEMBLY [concat_distinct]
--FROM 'C:\<your_compiled_assembly>.dll'
FROM 0x4D5A90000300000004000000FFFF0000B800000000000000400000000000000000000000000000000000000000000000000000000000000000000000800000000E1FBA0E00B409CD21B8014CCD21546869732070726F6772616D2063616E6E6F742062652072756E20696E20444F53206D6F64652E0D0D0A2400000000000000504500004C01030095B0EC560000000000000000E00002210B010B000010000000060000000000001E2F0000002000000040000000000010002000000002000004000000000000000400000000000000008000000002000000000000030040850000100000100000000010000010000000000000100000000000000000000000CC2E00004F000000004000003803000000000000000000000000000000000000006000000C000000942D00001C0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000080000000000000000000000082000004800000000000000000000002E74657874000000240F0000002000000010000000020