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 fourth or fifth time presenting this one.  Its going to be a lot of fun working with the new features …

Sessions Submitted for SQL Saturday – Olympia Read more »

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 working with the new features in TSQL 2012. Unleashing Common Table Expressions in SQL Server This will be about the …

Sessions for Code Camp in 2 weeks Read more »

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 Code Camp if it is going to be in Redmond. Looking forward to it.   Today I am tuning up …

Sessions Accepted for Seattle Code Camp 2012 Read more »

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 data paging server side in TSQL.  Thing of a page like your typical search results where you are shown the …

TSQL 2012 – OFFSET and FETCH Read more »

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 Server 2012. 10.  New SEQUENCE object 9.  CHOOSE function 8.  Analytics – Analytic Functions – PERCENT_RANK 7.  Analytics PERCENTILE_DISC and PERCENTILE_CONT 6. …

My Top 10 TSQL Enhancements in SQL Server 2012 Read more »

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 2012, I can safely say I like it. The answer used to be, just use the CASE statement, and the …

IIF in TRANSACT SQL on SQL SERVER 2012 Read more »

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 is where this example comes in. First lets take an example that generates simulated dice rolls.  What are the odds …

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

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 specified range. CUME_DIST  is the function that maps values to their percentile rank in a distribution.  CUME_DIST function calculates the possibility …

More TSQL 2012 Analytics CUME_DIST – Cumulative Distribution Read more »

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 posting earlier in the week, and the PERCENT_RANK posting yesterday, just a few values changed to show the differences between these …

More TSQL 2012 Analytics PERCENTILE_DISC and PERCENTILE_CONT Read more »

The OUTPUT clause is often times underappreciated by the TSQL programmer.  There are many really interesting things that you can do with the OUTPUT clause, from inserting to two tables with one statement or to replace the SCOPE_IDENTITY option.  For this posting I am looking into using the OUTPUT clause for auditing. By auditing in this example, I specifically mean …

Using the OUTPUT Clause in TSQL for Auditing Read more »