View: dbo.Sql_Server_Information_View | |||
View definition | |||
CREATE VIEW dbo.Sql_Server_Information_View AS SELECT -- cast and collate so these can be used in comparisons CAST(SERVERPROPERTY('productversion') AS NVARCHAR) COLLATE SQL_Latin1_General_CP1_CI_AS AS product_version, CAST(SERVERPROPERTY('productlevel') AS NVARCHAR) COLLATE SQL_Latin1_General_CP1_CI_AS AS product_level /* service pack */, CAST(SERVERPROPERTY('edition') AS NVARCHAR) COLLATE SQL_Latin1_General_CP1_CI_AS AS edition, -- For the size and SpaceUsed are in 8Kb units, convert to bytes. -- note that decimal(28,0) is the largest that can safely be read as a Decimal by C# programs: -- note that decimal(28,0) is the largest that can safely be read as a Decimal by C# programs: CAST (( SELECT SUM(size) FROM sys.database_files WHERE type = 0 /* data */ ) AS DECIMAL(28, 0)) * 8 * 1024 AS data_size; | |||