patternsqlMinor
Get major and minor version of SQL Server
Viewed 0 times
majorserverversionminorsqlgetand
Problem
Running following query:
produces the following results:
What am I missing?
SELECT
SERVERPROPERTY('productversion') AS version,
SERVERPROPERTY('ProductMajorVersion') AS major,
SERVERPROPERTY('ProductMinorVersion') AS minor;produces the following results:
version major minor
------------ ------- -------
10.0.2531.0 NULL NULLWhat am I missing?
Solution
The
ProductMajorVersion and ProductMinorVersion properties are only available in SQL Server 2012 and above (according to https://learn.microsoft.com/en-us/sql/t-sql/functions/serverproperty-transact-sql). Your product version indicates that this is SQL Server 2008 SP1, which does not support the two other properties.Context
StackExchange Database Administrators Q#180404, answer score: 9
Revisions (0)
No revisions yet.