sql >> Base de Datos >  >> RDS >> Sqlserver

¿Calcular el tamaño máximo de almacenamiento del registro de la tabla?

Prueba esto:

Select  schema_name(T.schema_id) As SchemaName,
        T.Name As TableName,
        Sum(C.max_length) As RowSize
From    sys.tables T
        Inner Join sys.columns C
            ON T.object_id = C.Object_ID
        INNER JOIN sys.types S
            On C.system_type_id = S.system_type_Id
Group By schema_name(T.schema_id),
        T.Name
Order By schema_name(T.schema_id),
        T.Name