Programming Microsoft SQL Server 2012 (Developer Reference)

Category: Programming
4.0
This Month Stack Overflow 1

Comments

by anonymous   2017-08-20

For performance tuning (including at the query level) see this dba.stackexchange question. I could repeat all of those suggestions here but I think it would be counter-productive.

It's not clear from your question and tag if you want to improve your skills at T-SQL in general, or if you want to focus on techniques new to SQL Server 2012. The above question should help for general knowledge, while the below will help for the newest version specifically (and those below will still include a lot of information that may help with earlier versions also - for example Itzik's book shows before and after queries for many common scenarios).

For SQL Server 2012 specifically, check out Itzik Ben-Gan's book on windowing functions in 2012; the new windowing functions offer many preferable solutions over existing approaches for certain query patterns (for example, it's the first time we have a supported and reliable approach for running totals that doesn't require (a) a cursor, (b) an exponentially expensive self-join or (c) an unsupported "quirky" update).

Books Online has a good summary of some of the new programmability enhancements in SQL Server 2012, and is probably a very good starting point for learning T-SQL syntax for things like SEQUENCE, FORMAT(), TRY_CONVERT() and OFFSET/FETCH. Some of the print books like Programming Microsoft SQL Server 2012 aren't released yet.