SQL Server – TSQL Analytics Word Search   Find the following words in the word scramble above. TOP RANK DENSE_RANK ROW_NUMBER NTILE OVER LAG LEAD FIRST_VALUE LAST_VALUE PERCENT_RANK PERCENTILE_DISC PERCENTILE_CONT CUME_DIST PARTITION ROWS PRECEDING FOLLOWING UNBOUNDED   Download the Printable PDF of the Word Search. See Also TSQL Queries – Using NTILE TOP, Ranking, NTILE, and Aggregate Functions TSQL Analytics FREE …

SQL Sunday Word Scramble Read more »

    Click on the grid to enlarge, then print it. Find the following words in the grid up, down, left, right, horizontal, vertical, and diagonal. ROWS  RANGE  PRECEDING  FOLLOWING  UNBOUNDED  IIF  CHOOSE  OFFSET  FETCH  FORMAT  CONCAT  SEQUENCE  PARSE  TRYPARSE  TRYCONVERT  THROW  LEAD  LAG  FIRSTVALUE  LASTVALUE  PERCENTRANK  CUMEDIST  PERCENTILEDISC  PERCENTILECONT  NOTE:  some of these terms normally have an underscore in …

SQL Sunday Fun – Word Search with New T-SQL 2012 Functionality Read more »

SQL Server 2012 adds many new features to Transact SQL (T-SQL).  One of my favorites is the Rows and Range enhancements to the over clause. These enhancements are often times referred to as the windowing functions. Want to learn more about the windowing functions? Check out this aggregation class that I have created: Overview:ROWS PRECEDING, FOLLOWING, UNBOUNDED, refers to the …

Rows and Range, Preceding and Following Read more »

It has been a year since SQL Server 2012 released. There were some fun posts on Twitter about the SQL Server 2012 birthday or anniversary. For instance: and another anniversary query (which doesn’t actually run): 1 year out since SQL 2012 released, and here are some things to note: There is no more Business Intelligence Development Studio (BIDS) in SQL …

Happy Birthday SQL Server 2012 Read more »

I am at SQL Saturday in Vancouver BC today. Here is the download of my presentation. Download zip file. Here is the presentation outline. OVER Clause Enhancements ROWS PRECEDING, FOLLOWING, UNBOUNDED RANGE PRECEDING, FOLLOWING, UNBOUNDED IIF – Immediate IF or Inline IF (from Access) CHOOSE (from Access) OFFSET / FETCH FORMAT CONCAT SEQUENCE (from Oracle) sp_describe_first_result_set New Date and Time …

SQL Saturday Presentation 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 »

In a previous article I covered the usage of ROWS PRECEDING and FOLLOWING in the over clause.  For this example I am going to use the same database and tables that I created in the previous example to show ROWS UNBOUNDED both PRECEEDING and FOLLOWING. One of the new features available in TSQL in SQL Server 2012 is the ROWS UNBOUNDED …

Transact SQL OVER Clause – ROWS UNBOUNDED PRECEDING or FOLLOWING Read more »