Use the following query to get the SQL Server version and edition:
SELECT SERVERPROPERTY('ProductVersion') AS Version,
SERVERPROPERTY('ProductLevel') AS ProductLevel,
SERVERPROPERTY('Edition') AS Edition;
This returns the version, product level (e.g., RTM, SP1), and edition of the SQL Server instance.