A select statement that returns the Version, Service Pack Level, and Edition information: (MS SQL 2000 and above)
[code]SELECT @@VERSION as ‘MS SQL’, SERVERPROPERTY(‘productversion’) as ‘Version’, SERVERPROPERTY (‘productlevel’) as ‘Level’, SERVERPROPERTY (‘edition’) as ‘Edition'[/code]
For MS SQL 7.0 and earlier use:
[code]SELECT @@VERSION[/code]
See Microsoft Knowledge Base KB321185 for more information.