Monthly Archives: June 2009

T-SQL String Aggregate in SQL Server

T-SQL dialect of SQL doesn’t have aggregate functions for strings, but there is an easy workaround using magic of XML.

Consider Employees table of the Northwind database. When I run following query:

SELECT Country, FirstName FROM Employees ORDER BY Country, FirstName

I get following result:

Country FirstName
UK      Anne
UK      Michael
UK      Robert
UK      Steven
USA     Andrew
USA     Janet
USA     Laura
USA     Margaret
USA     Nancy

Now I want to combine first names into comma separated strings grouped by country. Continue reading →

Free alternative to Dundas Charts from Microsoft

Since Dundas licensing scheme turned out to be insane, I was looking for an alternative and found this beauty

This free control from Microsoft is based on older version of Dundas chart, but offers pretty much the same features and almost the same API (minus some AJAX UI features). It requires .NET 3.5 SP1 and integrates into Visual Studio 2008 toolbar.

Happy charting 🙂