Microsoft SQL Server 2012 high-performance T-SQL using Window functions