Presentation is loading. Please wait.

Presentation is loading. Please wait.

T-SQL: Simple Changes That Go a Long Way

Similar presentations


Presentation on theme: "T-SQL: Simple Changes That Go a Long Way"— Presentation transcript:

1 T-SQL: Simple Changes That Go a Long Way
DAVE VALENTINE @ingeniousSQL ingeniousSQL.com linkedin.com/in/ingenioussql

2 Agenda OUTPUT INTO Table Valued Parameter Window Functions
Common Table Expressions COALESCE & ISNULL

3 Understand the Problem Before You Fix Create the Problem

4 About Dave… MCP MCSA: SQL Server 2012 Database / BI Developer
Adjunct Professor @IngeniousSQL IngeniousSQL.com

5 OUTPUT INSERT, UPDATE, DELETE, MERGE SCOPE_IDENTITY IDENT_CURRENT INSERTED.* and DELETED.*

6 INTO INTO <New Table> Debugging Table Definitions
TVP and Table Variables Indexes, Triggers and Constraints Identities

7 Table Valued Parameter
Easily store and transfer rows of data User Defined Table Type UNIQUE and PRIMARY KEY Constraints No indexing No statistics Read only as procedure parameters

8 T-SQL Window Functions
Ranking RANK, ROW_NUMBER, NTILE, DENSE_RANK Aggregate AVG, MIN, SUM, COUNT, STDEV, VAR, MAX Analytic LEAD, FIRST_VALUE, LAG, LAST_VALUE

9 Common Table Expressions
CTE Simplify query syntax Multiple reference Recursive queries VIEW alternative

10 COALESCE & ISNULL COALESCE (expression [,…n])
ISNULL (expression, expression) Data Types Optional Parameter CSV

11 T-SQL Simple Changes Demo

12 Summary INTO OUTPUT Table Valued Parameter Window Functions
Common Table Expressions COALESCE & ISNULL

13 Questions DAVE VALENTINE @ingeniousSQL ingeniousSQL.com
linkedin.com/in/ingenioussql


Download ppt "T-SQL: Simple Changes That Go a Long Way"

Similar presentations


Ads by Google