• J,

    I use this to keep track of the Version and Edition on all of our SQL Server systems.

    Written for use in both SQL Server 2000 and SQL Server 2005!

    Happy Coding!

    -- Show information about all SQL Server Databases in a given instance.

    -- SQL Server 2000

    USE master

    GO

    select

    -- getdate() as 'Time_Data_Gathered'

    --,

    cast(serverproperty('ServerName') as varchar(20)) as [Server Name]

    ,Case when serverproperty('InstanceName') is null

    then '(default)'

    else serverproperty('InstanceName')

    end as [Instance Name]

    ,name as [Database Name]

    ,cast(serverproperty('productversion') as varchar(20)) as [Product Version]

    ,cast(serverproperty('productlevel') as varchar(20)) as [Product Level]

    ,cast(serverproperty('edition') as varchar(40)) as [Edition]

    FROM dbo.sysdatabases

    -- SQL Server 2005

    USE master

    GO

    select

    -- getdate() as 'Time_Data_Gathered'

    --,

    cast(serverproperty('ServerName') as varchar(20)) as [Server Name]

    ,Case when serverproperty('InstanceName') is null

    then '(default)'

    else serverproperty('InstanceName')

    end as [Instance Name]

    ,name as [Database Name]

    ,cast(serverproperty('productversion') as varchar(20)) as [Product Version]

    ,cast(serverproperty('productlevel') as varchar(20)) as [Product Level]

    ,cast(serverproperty('edition') as varchar(40)) as [Edition]

    FROM sys.databases

    "Key"
    MCITP: DBA, MCSE, MCTS: SQL 2005, OCP