Default SqlServerCompatibilityLevel level

Posts   
 
    
Findev
User
Posts: 107
Joined: 08-Dec-2014
# Posted on: 21-Jul-2020 12:06:55   

Hi,

LLBLGen v5.7.0

was curious if docs need an update. When SqlServerCompatibilityLevel enum is decompiled:


/// <summary>
    /// Produce SQL which is compatible with SqlServer 2012 and up (default)
    /// </summary>
    SqlServer2012,

however https://www.llblgen.com/Documentation/5.7/LLBLGen%20Pro%20RTF/Using%20the%20generated%20code/FeaturesPerDB/Sqlserver.htm states:

By default the compatibility mode is set to SqlServerCompatibilityLevel.SqlServer2005

So which one? simple_smile

Thank you!

Walaa avatar
Walaa
Support Team
Posts: 14983
Joined: 21-Aug-2005
# Posted on: 21-Jul-2020 22:30:58   

Good catch. It's the 2005 one.

According to the following definition in the SQLServerDQE /DynamicQueryEngine.cd

private static SqlServerCompatibilityLevel _defaultCompatibilityLevel = SqlServerCompatibilityLevel.SqlServer2005;

Also in the generated DataAccessAdapter.cs it's mentioned that the default is 2005

private Nullable<SqlServerCompatibilityLevel> _compatibilityLevel = null;

/// <summary>The per-instance compatibility level used by this DQE instance. Default is the one set globally, which is by default SqlServer2005 (for 2005+).
/// Compatibility level influences the query generated for paging, sequence name (@@IDENTITY/SCOPE_IDENTITY()), and usage of newsequenceid() in inserts. 
/// It also influences the ado.net provider to use. This way you can switch between SqlServer server client 'SqlClient' and SqlServer CE Desktop.</summary>
public Nullable<SqlServerCompatibilityLevel> CompatibilityLevel
{
    get { return _compatibilityLevel; }
    set { _compatibilityLevel = value; }
}

Findev
User
Posts: 107
Joined: 08-Dec-2014
# Posted on: 21-Jul-2020 22:40:50   

Alright, I'll remove the web/app.config appSettings value and use:


.SetDefaultCompatibilityLevel( SqlServerCompatibilityLevel.SqlServer2012 )

then.

Thank you!

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39749
Joined: 17-Aug-2003
# Posted on: 22-Jul-2020 08:34:47   

As 2005 is out of support, it's a little weird we still have that as the default. We'll switch to 2012+ in the next version. (and will correct the comment)

Frans Bouma | Lead developer LLBLGen Pro
Findev
User
Posts: 107
Joined: 08-Dec-2014
# Posted on: 22-Jul-2020 08:38:26   

Otis wrote:

As 2005 is out of support, it's a little weird we still have that as the default. We'll switch to 2012+ in the next version. (and will correct the comment)

Alright, I'll keep the explicit config for now at least. Thank you! simple_smile