Compatibility level

  • Hi

    I changed the compatibility level of my sql servwer 2008 to 90(sql2005). I was thinking this will now throw error if I use some features of 2008. E.g. declaring a variable as date(this datatype was not present in 2005), declaring and initializing in one line e.g. declare @i int=5

    But id didn't throw any error. How come?

    Online Trainer For SQL DBA and Developer @RedBushTechnologies with 18 yrs exp.

  • Because

    SQL Server 2008 can work for Compatibility level 90 (for SQL Server 2005) and 80 (for SQL Server 2000)

    but SQL Server 2005 can't work on Compatibility level 100 (for SQL Server 2008)

  • Because the only thing that compatibility mode controls is how the query processor interprets some T-SQL constructs. It does not affect new features, it does not affect database structure.

    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
  • Hi Gail

    So it means that if change compatibility level in sql 2008 to 90(sql 2005), then it will support syntex for 2005 as well as 2008 in my TSQL. If I keep it at 100, then I maight get error in some syntex which was supported in 2005 but is now depricated in 2008.

    Thanks

    Online Trainer For SQL DBA and Developer @RedBushTechnologies with 18 yrs exp.

  • Yup. Mostly. There maybe things that won't work on compat mode 90 that will on 100 because of syntax rules, but it won't be a case where all 2008 features will be unavailable.

    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

Viewing 5 posts - 1 through 4 (of 4 total)

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