Checking the version of a SQL Server using T-SQL

There are couple of ways in which you can retreive the version of the SQL Server using T-SQL.

Checking the version of a SQL Server using T-SQL

1. using @@VERSION

SELECT @@VERSION
image

2. Using SERVERPROPERTY function as shown

SELECT SERVERPROPERTY('productversion') as version, SERVERPROPERTY('productlevel') as level,
SERVERPROPERTY('edition') as edition
image