Microsoft SQL Server check version and SP level

SELECT  SERVERPROPERTY(‘productversion’) as ‘Product Version’, SERVERPROPERTY (‘productlevel’) as ‘Product Level’, SERVERPROPERTY (‘edition’) as ‘Edition’

Query is show information about MS SQL Server like below

Product Version Product Level Edition
9.00.3042.00 SP2 Enterprise Edition (64-bit)

Or use
SELECT @@VERSION
GO

It will show like following information

Microsoft SQL Server 2005 – 9.00.3042.00 (X64)   Feb 10 2007 00:59:02   Copyright (c) 1988-2005 Microsoft Corporation  Enterprise Edition (64-bit) on Windows NT 5.2 (Build 3790: Service Pack 2)