I have a SQL Server 2012 database which users can attach files to (mainly Jpgs) however the table size is 130mb with only 20 records.
I need to find out which row is using the most amount of space.
The data is stored as varbinary
Thanks
I have a SQL Server 2012 database which users can attach files to (mainly Jpgs) however the table size is 130mb with only 20 records.
I need to find out which row is using the most amount of space.
The data is stored as varbinary
Thanks
You can use DATALENGTH
to get the length of the varbinary
column:
SELECT Id, Name, DATALENGTH(BinaryColumn)
FROM dbo.YourTable
ORDER BY DATALENGTH(BinaryColumn) DESC