Since the early versions of SQL Server, from version 6.5 we can know and determine the latest version that we install in our machine. I will show you the list that determine the latest version of the SQL Server.
In SQL Server 2008/2005 (using SSMS) & 2000 (using Query Analyzer) we can use the script below to take the info about SQL Server version:
SERVERPROPERTY ('Productversion') AS Productversion,
SERVERPROPERTY ('Productlevel') AS Productlevel,
SERVERPROPERTY ('Edition') AS Edition
The ProductVersion will show us the latest version that we have in our machine.
SQL Server 2008
SQL Server 2005
SQL Server 2000
In SQL Server 7 & 6.5 to determine the version we should use the statement SELECT @@VERSION and for more info about details and results you can check here.
If you want to see more info about your SQL Server try this script here and you will retrieve really much from your machine.
Don't forget to check the build list of the SQL Server 2008 or here.