Sqlserver
 sql >> Datenbank >  >> RDS >> Sqlserver

Berechnen Sie die maximale Speichergröße des Tabellendatensatzes?

Versuchen Sie Folgendes:

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