Tablas , Top , Tamaño y Registros
SELECT top 50 ON (si.id = so.id) 8 * Sum(CASE WHEN si.indid IN (0, 1) THEN si.reserved END) + Coalesce(8 * Sum(CASE WHEN si.indid NOT IN (0, 1, 255) THEN si.reserved END), 0)
so.name,
FILEGROUP_NAME(si.groupid) file_group,
Coalesce(8 * Sum(CASE WHEN si.indid IN (255) THEN si.reserved END), 0) +
8 * Sum(CASE WHEN si.indid IN (0, 1) THEN si.reserved END) +
Coalesce(8 * Sum(CASE WHEN si.indid NOT IN (0, 1, 255) THEN si.reserved END), 0) AS total_kb,
(Coalesce(8 * Sum(CASE WHEN si.indid IN (255) THEN si.reserved END), 0) +
8 * Sum(CASE WHEN si.indid IN (0, 1) THEN si.reserved END) +
Coalesce(8 * Sum(CASE WHEN si.indid NOT IN (0, 1, 255) THEN si.reserved END), 0))/1024 AS total_Mg,
cast(((Coalesce(8 * Sum(CASE WHEN si.indid IN (255) THEN si.reserved END), 0) +
8 * Sum(CASE WHEN si.indid IN (0, 1) THEN si.reserved END) +
Coalesce(8 * Sum(CASE WHEN si.indid NOT IN (0, 1, 255) THEN si.reserved END), 0))/1024)/1024.0 as decimal(10,2)) AS total_gb,
Coalesce(8 * Sum(CASE WHEN si.indid IN (255) THEN si.reserved END), 0) AS blob_kb,
8 * Sum(CASE WHEN si.indid IN (0, 1) THEN si.reserved END) AS data_kb,
Coalesce(8 * Sum(CASE WHEN si.indid NOT IN (0, 1, 255) THEN si.reserved END), 0) AS index_kb,
Coalesce(8 * Sum(CASE WHEN si.indid IN (255) THEN si.reserved END), 0) AS blob_kb,
8 * Sum(CASE WHEN si.indid IN (0, 1) THEN si.reserved END) / 1024 AS data_Mb,
Coalesce(8 * Sum(CASE WHEN si.indid NOT IN (0, 1, 255) THEN si.reserved END), 0) / 1024 AS index_Mb,
max(si.rowcnt) as cantidadRegistos,
cast((Coalesce(8 * Sum(CASE WHEN si.indid IN (255) THEN si.reserved END), 0) +
8 * Sum(CASE WHEN si.indid IN (0, 1) THEN si.reserved END) +
Coalesce(8 * Sum(CASE WHEN si.indid NOT IN (0, 1, 255) THEN si.reserved END), 0))
/ case when max(si.rowcnt) = 0 then null else cast(max(si.rowcnt) as decimal(15,2))
/ 1024 end as decimal (15,0)) as bPerRow
FROM dbo.sysobjects AS so (nolock)
JOIN dbo.sysindexes AS si (nolock)
WHERE ’U’ = so.type
GROUP BY so.name,si.groupid
ORDER BY Coalesce(8 * Sum(CASE WHEN si.indid IN (255) THEN si.reserved END), 0) +
desc
0 comentarios