T-SQL Cheat Sheet | SQL Server Quick Reference for Developers | Printable A4 PDF
The SQL Server features generic cheat sheets skip, all in one place. This T-SQL cheat sheet is written by a working SQL developer for people who write T-SQL every day, from temp tables and APPLY to error handling and performance tuning.
It's for SQL Server developers, DBAs, report writers, and anyone moving from general SQL to working in SQL Server. It targets SQL Server 2017 and later, with notes where older versions differ.
What's included (5 pages)
- Cover page
- T-SQL Essentials: GO and batches, variables, TOP with TIES and PERCENT, paging, IF and WHILE, checking whether objects exist, common data types and SSMS shortcuts.
- Dates, Text & Conversion: safe date literals, date functions such as DATEADD, DATEDIFF and EOMONTH, text functions, STRING_AGG and STRING_SPLIT, CAST, CONVERT and TRY_CAST, and ISNULL vs COALESCE.
- Temp Tables, APPLY & MERGE: #temp vs @table variables, SELECT INTO, the OUTPUT clause, IDENTITY_INSERT, CROSS APPLY and OUTER APPLY, MERGE, and PIVOT.
- Errors, Procedures & Performance: TRY...CATCH with transactions, stored procedures, safe dynamic SQL, useful system functions, a performance checklist, covering indexes, and a query to find your slowest queries.
Features
- Instant download: nothing will be posted to you
- A4 PDF, which also prints on US Letter if you choose "Fit to page"
- Colour-highlighted code examples that are easy to scan
- Real-world gotchas included, like date formats and MERGE concurrency
- Works on screen or printed out and pinned by your desk
New to SQL?
The general SQL Cheat Sheet, covering SQL Server, MySQL and PostgreSQL, is also available in my shop. It's a great starting point before moving on to T-SQL.
Please note
This is a digital product and no physical item will be sent. The file is for personal use only and may not be shared, resold or redistributed.