Get physical field size using SQL Server : SQL command to get the Bytes or KBytes taken by a field on a SQL Server table.

To get the Bytes:

SELECT SUM(DATALENGTH(FIELD_NAME)) AS BYTES FROM TABLE_NAME

To get the KBytes:

SELECT SUM(DATALENGTH(FIELD_NAME)) / 1024 AS KBYTES FROM TABLE_NAME

Read also : Solution for : Enable SQL Server system versioning

Tagged:

Laisser un commentaire