How to Generate SQL Scripts for Previous Versions of MS SQL?

There are situations when you need to generate SQL scripts for earlier versions of the database server. For example, you may have 2019 installed in a development environment and 2014 installed in a production environment. And when you generate scripts through the Script Table As context menu, there will most likely be differences. You can use the MS SQL Management Studio options to set the script version for compatibility, please check the image:
Generate SQL Scripts for Previous Versions of MS SQL

Follow the next steps:

  1. Navigate to Tools -> Options
  2. Choose SQL Server Object Explorer -> Scripting
  3. Version Options: Set Match script settings to source to False
  4. Choose ‘Script for server version’: SQL Server 2005 – 2019

Available versions: SQL Server 2005, SQL Server 2008, SQL Server 2008 R2, SQL Server 2012, SQL Server 2014, SQL Server 2016, SQL Server 2019.

Leave a Comment