SQL Compatibility Mode Questions

  • Hello again!

    We have recently upgraded from SQL 2000 to SQL 2008 and you would think with my 10+ years experience that I would have known that the compatibility mode of the DB did not automatically change to 2008 when I configured the server. Be that as it may, I figured it out and changed it to 100.

    However, we apparently have queries and logic that is not compatible with 100. So, I had to change it back to 80.

    Is there a tool or an extended stored procedure that will identify all the things I need to change? It really isn't feasable for me to go through every single thing in the DB and check it.

    I'm really bummed about this cause now I can't use some of the new features of SQL 2008 :angry:

    And there isn't any way to set certain things in the DB to 80 and other things to 100 is there?

    Thanks!

  • Try looking at the upgrade advisor. http://www.microsoft.com/en-us/download/details.aspx?id=11455

    And no you can't have part of the database in 80 and others in 100. It is set at the database level.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

  • amy26 (4/2/2013)


    I'm really bummed about this cause now I can't use some of the new features of SQL 2008 :angry:

    Why not?

    Comparability level doesn't disable new features, it just changes how the query execution engine handles some constructs and whether some forms of SQL are valid or not.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • GilaMonster (4/2/2013)


    amy26 (4/2/2013)


    I'm really bummed about this cause now I can't use some of the new features of SQL 2008 :angry:

    Why not?

    Comparability level doesn't disable new features, it just changes how the query execution engine handles some constructs and whether some forms of SQL are valid or not.

    Well, for example... I wrote a stored procedure that uses PIVOT and I cannot run this procedure when the compatibility mode is set to 80. It will only work if its set to 100.

  • Sean Lange (4/2/2013)


    Try looking at the upgrade advisor. http://www.microsoft.com/en-us/download/details.aspx?id=11455

    And no you can't have part of the database in 80 and others in 100. It is set at the database level.

    We ran the upgrade advisor initially and it didn't find anything blaring things that would not upgrade. It didn't mention anything about the compatibility mode. We were able to get everything on to SQL 2008 already ... and I can't run the upgrade advisor now as we don't have any SQL 2000 machines anymore.

  • amy26 (4/2/2013)


    GilaMonster (4/2/2013)


    amy26 (4/2/2013)


    I'm really bummed about this cause now I can't use some of the new features of SQL 2008 :angry:

    Why not?

    Comparability level doesn't disable new features, it just changes how the query execution engine handles some constructs and whether some forms of SQL are valid or not.

    Well, for example... I wrote a stored procedure that uses PIVOT and I cannot run this procedure when the compatibility mode is set to 80. It will only work if its set to 100.

    Yes, Pivot is the exception, along with CROSS APPLY iirc. Most of the other new features work fine regardless of compat mode.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • amy26 (4/2/2013)


    GilaMonster (4/2/2013)


    amy26 (4/2/2013)


    I'm really bummed about this cause now I can't use some of the new features of SQL 2008 :angry:

    Why not?

    Comparability level doesn't disable new features, it just changes how the query execution engine handles some constructs and whether some forms of SQL are valid or not.

    Well, for example... I wrote a stored procedure that uses PIVOT and I cannot run this procedure when the compatibility mode is set to 80. It will only work if its set to 100.

    The trick to get around this type of limitation is to create a separate database - set the compatibility to 100 and run your code from that database using 3-part naming (or synonyms) to reference the tables in the 80 database.

    One way of 'tricking' the system to do this is to create a new procedure in the 100 database that has your working code. Rename the old procedure in the 80 database and then create a synonym for the original procedure. The synonym will then reference your new code.

    Jeffrey Williams
    “We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”

    ― Charles R. Swindoll

    How to post questions to get better answers faster
    Managing Transaction Logs

  • Ah, now that is an interesting concept..... very interesting indeed! Thank you for that... I am going to mull that over in my brain for a while!

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply