• Good to see an article on a tricky and quite important piece of code.

    Although, with SQL Server 2008 around, I am surprised that you did not mention the Table user defined type and the MERGE statement?