Skip to content

TechDirectArchive

Hands-on IT, Cloud, Security, Veeam & DevOps

  • Home
  • About
  • Advertise With US
  • Reviews
  • Tech News
  • Contact
  • Toggle search form

How to alter a DATABASE compatibility level

Posted on 17/03/202114/03/2024 IT Expert By IT Expert No Comments on How to alter a DATABASE compatibility level
  1. Home
  2. Oracle/MSSQL/MySQL
  3. How to alter a DATABASE compatibility level
Change database compatibility level

In this article, we will learn how to alter a DATABASE compatibility level. Please see some related MSSQL guides I have written. What are the differences between various Editions of Microsoft SQL Server. How to install MSSQL Server 2019 Developer Edition and SSMS on Windows. Database Compatibility Level is a valuable tool to assist in database modernization. it does this by allowing the SQL Server Database Engine to be upgraded while keeping connecting applications functional status by maintaining the same pre-upgrade Database Compatibility Level.

This means that it is possible to upgrade from an older version of SQL Server (such as SQL Server 2008) to SQL Server or Azure SQL Database. This includes Managed Instances) with no application changes (except for database connectivity).

A compatibility level is associated with each database. It allows the behaviour of the database to be compatible with the specific version of SQL Server it is running on. 
- I had the need to alter MSSQL Server 2019 compatibility level from 150 to 140 to support MBAM deployment, before switching to a different SQL version 2017 in my test environment. 

See more on SA “how to reset MSSQL Server SA Password on Ubuntu via the command line and SQL Server Management Studio“. See how to download and install Microsoft SQL Server 2019 Express edition and SSMS.

Modifying Compatibility Levels in MSSQL Server

In addition, here is a command and options to set any of the compatibility levels. Where the database_name Is the name of the database to be modified “ALTER DATABASE database_name SET COMPATIBILITY_LEVEL = { 150 | 140 | 130 | 120 | 110 | 100 | 90 }“.

Therefore, I had to run the command below to modify my compatibility level. Nonetheless, Here i will be able to set an SA account.

ALTER DATABASE MBAM SET COMPATIBILITY_LEVEL = 140

Never change the compatibility level while users are connected. It is preferable that you follow these steps to properly do the job.

Note: Remember to commit your changes to the database. The following compatibility level values can be configured (not all versions support all of the above-listed compatibility level.

ProductDatabase Engine VersionDefault Compatibility Level DesignationSupported Compatibility Level Values
SQL Server 2019 (15.x)15150150, 140, 130, 120, 110, 100
SQL Server 2017 (14.x)14140140, 130, 120, 110, 100
Azure SQL Database12150150, 140, 130, 120, 110, 100
Azure SQL Database Managed Instance12150150, 140, 130, 120, 110, 100
SQL Server 2016 (13.x)13130130, 120, 110, 100
SQL Server 2014 (12.x)12120120, 110, 100
SQL Server 2012 (11.x)11110110, 100, 90
SQL Server 2008 R210.5100100, 90, 80
SQL Server 200810100100, 90, 80
SQL Server 2005 (9.x)99090, 80
SQL Server 2000 (8.x)88080

Note: You can use a database with backward compatibility. The database compatibility level setting ensures backward compatibility with earlier SQL Server versions. Affecting only the specified database’s Transact-SQL and query optimization behaviours, not the entire server.

You may want to learn more about the difference between compatibility 140 and 150. Please refer to the table below.

Understanding Database Compatibility Levels

Compatibility level setting of 140 or lowerCompatibility level setting of 150
Relational data warehouse and analytic workloads may not be able to leverage columnstore indexes due to OLTP-overhead, lack of vendor support or other limitations. Without columnstore indexes, these workloads cannot benefit from batch execution mode.The batch execution mode is now available for analytic workloads without requiring column store indexes. For more information, see batch mode on rowstore.
Row-mode queries that request insufficient memory grant sizes that result in spills to disk may continue to have issues on consecutive executions.Row-mode queries that request insufficient memory grant sizes that result in spills to disk may have improved performance on consecutive executions. For more information, see row mode memory grant feedback.
Row-mode queries that request an excessive memory grant size that results in concurrency issues may continue to have issues on consecutive executions.Row-mode queries that request an excessive memory grant size that results in concurrency issues may have improved concurrency on consecutive executions. For more information, see row mode memory grant feedback.
Queries referencing T-SQL scalar UDFs will use iterative invocation, lack costing, and force serial execution.T-SQL scalar UDFs are transformed into equivalent relational expressions that are “inlined” into the calling query, often resulting in significant performance gains. For more information, see T-SQL scalar UDF inlining.
Table variables use a fixed guess for the cardinality estimate. If the actual number of rows is much higher than the guessed value, performance of downstream operations can suffer.New plans will use the actual cardinality of the table variable encountered on the first compilation instead of a fixed guess. For more information, see table variable deferred compilation.

View Microsoft SQl Server compatibility level

Furthermore, as we’ve chosen SQL Server 2017. Let me demonstrate how to easily check the compatibility level using SQL Server Management Studio (SSMS).

To view the compatibility level of each database. Right-click the database in SQL Server Management Studio, select Properties, and click the Options tab. See the image below for more information.

Screenshot-2021-03-17-at-00.21.53-1

I hope you found this blog post on how to alter a DATABASE compatibility level helpful. Moreover, please let me know in the comment session if you have any questions.

Rate this post

Thank you for reading this post. Kindly share it with others.

  • Share on X (Opens in new window) X
  • Share on Reddit (Opens in new window) Reddit
  • Share on LinkedIn (Opens in new window) LinkedIn
  • Share on Facebook (Opens in new window) Facebook
  • Share on Pinterest (Opens in new window) Pinterest
  • Share on Tumblr (Opens in new window) Tumblr
  • Share on Telegram (Opens in new window) Telegram
  • Share on WhatsApp (Opens in new window) WhatsApp
  • Share on Mastodon (Opens in new window) Mastodon
  • Share on Bluesky (Opens in new window) Bluesky
  • Share on Threads (Opens in new window) Threads
  • Share on Nextdoor (Opens in new window) Nextdoor
Oracle/MSSQL/MySQL Tags:Microsoft SQL, Microsoft SQL Server 2019 Express Edition, Microsoft SQL Server Management Studio, Microsoft SQL Server Studio, MsSQL, MsSQL Editions, SSMS

Post navigation

Previous Post: Configure log on as a batch job permissions on any server
Next Post: Unable to install Microsoft Bitlocker Administration: Uninstall your current version of MBAM and run setup again

Related Posts

  • no pg hba
    Resolve “no pg_hba.conf entry for host on PostgreSQL Oracle/MSSQL/MySQL
  • How to visualize MBAM Recovery Audit Report with Python
    Visualize MBAM Recovery Audit Report with Python Automation
  • Migrate from SQL Database
    Migrate Veeam One Database from SQL Server 2017 to 2025 Backup
  • Drop or delete a MySQL user from phpmyAdmin
    How to delete a MySQL User Account Oracle/MSSQL/MySQL
  • the Execute permission was denied
    Fix An error has occurred during report processing (rsProcessingAborted) Oracle/MSSQL/MySQL
  • create a new Azure SQL Database
    How to create a new Azure SQL Database [PaaS] AWS/Azure/OpenShift

More Related Articles

no pg hba Resolve “no pg_hba.conf entry for host on PostgreSQL Oracle/MSSQL/MySQL
How to visualize MBAM Recovery Audit Report with Python Visualize MBAM Recovery Audit Report with Python Automation
Migrate from SQL Database Migrate Veeam One Database from SQL Server 2017 to 2025 Backup
Drop or delete a MySQL user from phpmyAdmin How to delete a MySQL User Account Oracle/MSSQL/MySQL
the Execute permission was denied Fix An error has occurred during report processing (rsProcessingAborted) Oracle/MSSQL/MySQL
create a new Azure SQL Database How to create a new Azure SQL Database [PaaS] AWS/Azure/OpenShift

Leave a Reply Cancel reply

You must be logged in to post a comment.

Microsoft MVP

VEEAMLEGEND

vexpert-badge-stars-5

Virtual Background

GoogleNews

Categories

veeaam100

Veeam Vanguard

  • maxresdefault 2 5
    Why am I unable to ping the Public IP Address of an EC2 instance AWS/Azure/OpenShift
  • printserver
    How to set up a Print Server on Windows Servers Windows
  • How to setup a new computer without a Microsoft account
    How To Setup A New Computer Without A Microsoft Account on Windows 11 Windows
  • ext
    How to install a standalone DriveLock Encryption software on Windows Security | Vulnerability Scans and Assessment
  • cisco ASA
    Common Cisco ASA Commands Network | Monitoring
  • Opswork blog 1440x800 1
    AWS Opsworks For Chef Automate Configuration Management Tool
  • 1 pUEZd8z  1p 7ICIO1NZFA
    The package python-virtualenv has no installation candidate error Linux
  • hero windowsserver hyperv
    Pass-Through Authentication Authentication and ADFS environment setup on Hyper-V for Hybrid Identity integration Virtualization

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 1,779 other subscribers
  • RSS - Posts
  • RSS - Comments
  • About
  • Authors
  • Write for us
  • Advertise with us
  • General Terms and Conditions
  • Privacy policy
  • Feedly
  • Telegram
  • Youtube
  • Facebook
  • Instagram
  • LinkedIn
  • Tumblr
  • Pinterest
  • Twitter
  • mastodon

Tags

Active Directory Azure Bitlocker Microsoft Windows PowerShell WDS Windows 10 Windows 11 Windows Deployment Services Windows Server 2016

Copyright © 2026 TechDirectArchive

Loading Comments...

You must be logged in to post a comment.