Database Reference
In-Depth Information
There's more...
The query has two disk-sized columns that return a result set in bytes. The values are easier
to read and manage when read in megabytes (MB) or gigabytes (GB).
Converting byte values into MB or GB values
You can perform the conversion of byte values into MB or GB in the query using the
SQL
ROUND
function. When this function is applied to the SQL query to convert the sizes into
GB, it will change the SQL query to the following:
SELECT vw_DPM_Agents.ServerName
,vw_DPM_Agents.Version
,ROUND
(vw_DPM_ProtectedDataSource.UsedSize /1024 /1024 /1024 ,2)
AS
UsedSpaceGB
,ROUND
(vw_DPM_ProtectedDataSource.AllocatedSize /1024 /1024 /1024
,2) AS AllocatedSizeGB
, vw_DPM_ProtectedDataSource.StorageNode AS
Assigned_DPMServer
,dbo.vw_DPM_ProtectedGroup.ProtectedGroupName
FROM vw_DPM_Agents INNER JOIN
dbo.vw_DPM_ProtectedDataSource ON
dbo.vw_DPM_Agents.ServerName =
dbo.vw_DPM_ProtectedDataSource.ProductionServerName
INNER JOIN dbo.vw_DPM_ProtectedGroup ON
dbo.vw_DPM_ProtectedDataSource.ProtectedGroupId =
dbo.vw_DPM_ProtectedGroup.ProtectedGroupId