Fix for versions of SQL Server < 2012