Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

What exactly gets enabled in SQL 2012 when you set compatibility mode to 110 Expand / Collapse
Author
Message
Posted Thursday, May 22, 2014 6:46 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Friday, July 18, 2014 9:49 AM
Points: 48, Visits: 67
Some new functions (eg. CONCAT) work as soon as you migrate to 2012 and leave compat mode at 100. But other functions (eg. PERCENTILE_CONT) need to have compat mode at 110 in order to work.

Is there a list somewhere of what new functions work simply by upgrading to SQL 2012, and what needs to have compat mode set to 110?
Post #1573553
Posted Friday, May 23, 2014 6:59 AM


SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Thursday, August 21, 2014 11:49 AM
Points: 223, Visits: 338
john.p.lantz (5/22/2014)
Some new functions (eg. CONCAT) work as soon as you migrate to 2012 and leave compat mode at 100. But other functions (eg. PERCENTILE_CONT) need to have compat mode at 110 in order to work.

Is there a list somewhere of what new functions work simply by upgrading to SQL 2012, and what needs to have compat mode set to 110?


There's quite a bit---start with this MSDN article first, and see if your questions are answered there, as their lists here will be more complete than anything I could ever recite from memory:
http://msdn.microsoft.com/en-us/library/bb510680%28v=sql.110%29.aspx
Post #1573992
Posted Tuesday, May 27, 2014 5:21 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Friday, July 18, 2014 9:49 AM
Points: 48, Visits: 67
I've looked at that MSDN article before, but it doesn't explain what I am seeing. Take the one example (PERCENTILE_CONT), that is not mentioned at all in article under the section (differences between 100 and 110). But it's something that is only available after you set compat mode to 110.
Post #1574737
Posted Tuesday, May 27, 2014 6:25 AM


SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Thursday, August 21, 2014 11:49 AM
Points: 223, Visits: 338
You're 100% correct---and this behavior appears to be undocumented on MSDN. Attempting to run a query with this analytic function results in:

Msg 10762, Level 15, State 1, Line 4
The PERCENTILE_CONT function is not allowed in the current compatibility mode. It is only allowed in 110 mode or higher.

The following analytic functions work normally under 100 compatibility mode in SQL Server 2012:
CUME_DIST
FIRST_VALUE
LEAD
LAG
LAST_VALUE
PERCENT_RANK

The following functions are unavailable below compatibility mode 110:
PERCENTILE_CONT
PERCENTILE_DISC

Further research shows no documentation anywhere regarding these functions and compatibility modes. I was able to easily reproduce (and fix) by taking a test database and switching between compatibility modes.

I'll send a note to Microsoft advising them to update their documentation regarding both of these functions.
Post #1574749
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse