select @@version
Sample Output
Microsoft SQL Server 2008 (SP1) – 10.0.2531.0 (X64) Mar 29 2009 10:11:52 Copyright (c) 1988-2008 Microsoft Corporation Developer Edition (64-bit) on Windows NT 6.1 (Build 7600: )
If you just want to get the edition, you can use:
select serverproperty('Edition')
To use in an automated script, you can get the edition ID, which is an integer:
select serverproperty('EditionID')
- -1253826760 = Desktop
- -1592396055 = Express
- -1534726760 = Standard
- 1333529388 = Workgroup
- 1804890536 = Enterprise
- -323382091 = Personal
- -2117995310 = Developer
- 610778273 = Enterprise Evaluation
- 1044790755 = Windows Embedded SQL
- 4161255391 = Express with Advanced Services