How to tell what version of SQL Server you’re running

Anytime something doesn’t work quite right, there’s always the question of
which version and service pack level of SQL Server you’re running.

For SQL Server 2005, there’s a simple query you can run which will tell you
the version, service pack and edition (standard, enterprise, etc):

(‘productlevel’), SERVERPROPERTY (‘edition’)

The full article, with queries for SQL Server 6.5 to 2005, is at