Project that uses both SQL Server 2000 and SQL Server 2005

Posts   
 
    
Darren166
User
Posts: 41
Joined: 30-Jan-2007
# Posted on: 03-Apr-2007 20:17:32   

Hi,

I have a web project that requires a DAL for SQL server 2000 and SQL Server 2005. I used LLBLGen twice to create two separate class libraries for these data layers and all works ok. However I want to optimise the SQL for SQL Server 2005 by using the SqlServerDQECompatibilityLevel key. It seems that I can only enter this key once in my web.config so is there a way to say 'use level 1 for this DAL and level 2 for that DAL'?

Thanks, Darren.

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 04-Apr-2007 10:14:32   

The following is copied from the docs:

DQE Compatibility mode(SqlServer only) With the arrival of SqlServer 2005 and its new features, it was required to make the SqlServer DQE be configurable so it could generate SQL which was optimal for the database type used. To set the compatibility mode of the SqlServer DQE in code, you can use the DataAccessAdapter method SetSqlServerCompatibilityLevel, as shown in the following example which sets the compatibility mode to SqlServer 2005: // C# DataAccessAdapter.SetSqlServerCompatibilityLevel( SqlServerCompatibilityLevel.SqlServer2005 );

The different compatibility modes are: SqlServerCompatibilityLevel.SqlServer7 (or the value 0) SqlServerCompatibilityLevel.SqlServer2000 (or the value 1) SqlServerCompatibilityLevel.SqlServer2005 (or the value 2)

Darren166
User
Posts: 41
Joined: 30-Jan-2007
# Posted on: 04-Apr-2007 12:34:11   

Thanks Walaa, that one passed me by unnoticed! I am using self serving so the DBUtils equivalent is the one I will use.

Darren