SQL Flow Field Guide

Check the SQL Server version

Read the engine version before choosing syntax.

What you are trying to do

A new joiner receives a script with a version-specific feature and must check the target engine first.

Work through it

  1. Read the product version and major version from the current connection.
  2. Compare the result with the version labels on the linked Microsoft Learn page.
  3. Keep version checks separate from a database change.

Check your work

The product version and major version identify the engine that will parse the script.

Practice SQL

Open in SQL Flow
SELECT SERVERPROPERTY('ProductVersion') AS ProductVersion, SERVERPROPERTY('ProductMajorVersion') AS MajorVersion;

Commands in this lesson

Next lesson Read a small result