SSP-1318 - fixed sqlserver grammar issue with custom sql formula