CompatibilityLevel Property (Database)

SQL-DMO

SQL-DMO

CompatibilityLevel Property (Database)

The CompatibilityLevel property controls the behavior of an instance of Microsoft® SQL Server™, setting behavior to match either the current or earlier version.

Applies To
Database Object
Syntax

object.CompatibilityLevel [= value]

object

Expression that evaluates to an object in the Applies To list

value

Long integer that specifies an instance of SQL Server as described in Settings

Data Type

Long, enumerated

Modifiable

Read/write

Prototype (C/C++)

HRESULT GetCompatibilityLevel(
SQLDMO_COMP_LEVEL_TYPE* pRetVal);

HRESULT SetCompatibilityLevel(
SQLDMO_COMP_LEVEL_TYPE NewValue);

Settings

Set CompatibilityLevel using these SQLDMO_COMP_LEVEL_TYPE values.

Constant Value Description
SQLDMOCompLevel_60 60 Force SQL Server version 6.0 behavior.
SQLDMOCompLevel_65 65 Force SQL Server version 6.5 behavior.
SQLDMOCompLevel_70 70 Force SQL Server version 7.0 behavior.
SQLDMOCompLevel_80 80 Default. Instance behaves as documented for SQL Server 2000.
SQLDMOCompLevel_Unknown 0 Bad or invalid value.

See Also

Backward Compatibility