Skip to content

Instantly share code, notes, and snippets.

@tdoumas
tdoumas / STRING_AGG.cs
Last active April 17, 2022 19:29 — forked from lbehm/STRING_AGG.cs
SQL Server Aggregate to concatenate strings - shim for STRING_AGG
using System;
using System.Data.SqlTypes;
using System.IO;
using System.Text;
using Microsoft.SqlServer.Server;
[Serializable]
[SqlUserDefinedAggregate(
Format.UserDefined,
IsInvariantToNulls = true,
/// <summary>
/// Get Catholic easter for requested year
/// </summary>
/// <param name="year">Year of easter</param>
/// <returns>DateTime of Catholic Easter</returns>
public static DateTime GetCatholicEaster(int year)
{
var month = 3;
var a = year % 19 + 1;