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
- Read the product version and major version from the current connection.
- Compare the result with the version labels on the linked Microsoft Learn page.
- 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 FlowSELECT SERVERPROPERTY('ProductVersion') AS ProductVersion, SERVERPROPERTY('ProductMajorVersion') AS MajorVersion;
Commands in this lesson
Next lesson Read a small result