Category: TSQL 2012

TSQL 2012 CHOOSE Function

In SQL Server 2012 there is a new function called CHOOSE that takes in an offset, and a list of options.  Choose is a function that returns the item at a specific index. Syntax: —CHOOSE(index, val_1, val_2, val_3, …) —If

Tagged with: , , ,

Sessions Submitted for SQL Saturday – Olympia

SQL Saturday 166 in Olympia WA on November 10th was announced, and that one is close enough to drive to.  I have submitted 2 sessions for this event.   What’s New in TSQL 2012 By November, this with be the

Tagged with: , ,

Sessions for Code Camp in 2 weeks

Here are the sessions that I will be presenting at Code Camp in two weeks.. What’s New in TSQL 2012 This is the first time that I will be presenting this one.  Its going to be a lot of fun

Tagged with: , ,

Sessions Accepted for Seattle Code Camp 2012

I learned today that several of the sessions that I pitched for Code Camp 2012 have been accepted. Code Camp will be on Saturday June 16th 2012 in Redmond WA.   I am not sure why the call it Seattle

Tagged with: , , ,


Its about time, MySQL has had a feature LIMIT which is similar to the  usage of OFFSET and FETCH for years.  Now in SQL Server 2012 Microsoft introduces OFFSET and FETCH. The OFFSET and FETCH functionality is used to achieve

Tagged with: , , , , , , ,

My Top 10 TSQL Enhancements in SQL Server 2012

So far after playing around with SQL Server 2012 there are many new features to SQL.  Overall I think my favorites are in the Analytic Functions category.  Here is my breakdown of the top 10 transact SQL enhancements to SQL

Tagged with: , , , , , , ,


For years I have heard the question of how can I do an IIF in TSQL?  Honestly I never thought it would be that useful since the CASE statement is easy enough to use, but after seeing it in TSQL

Tagged with: , , , ,

Cumulative Distribution Function (CDF) – Analyzing the Roll of Dice with TSQL

After the last post on Cumulative Distribution Function (CDF) or as it is known in TSQL CUME_DIST(), I realized that although I showed how to use it, I didn’t really explain what it means, or when to use it.  That

Tagged with: , , , ,

More TSQL 2012 Analytics CUME_DIST – Cumulative Distribution

Continuing on the TSQL 2012 Analytic Series now on to the CUME_DIST function SQL Server 2012 introduces another new analytic function.  The Cumulative Distribution Function CUME_DIST()  refers to the probability that the value of a random variable falls within a

Tagged with:


Like the other new Analytic functions, PERCENTILE_DISC and PERCENTILE_CONT require the use of the OVER clause. For this example I will be using almost the same revenue table in the sample database that I set up for the LEAD and LAG

Tagged with: ,