Find out how much storage the row in the database takes.

Is there a way to find out how much space (on disk) does a row in my database occupy?

I would really like to see it for SQL Server CE, but SQL Server 2008 does not work (I keep the same data in both).

I ask that I have an Image column in my SQL Server CE db (this is varbinary [max] in SQL DB 2008 db), and now I need to know a lot of rows that I can save before I select memory on my device.

+3
source share
3 answers

Maybe not 100% what you wanted, but if you want to know how much image size will only take

SELECT [RaportID]
                      ,DATALENGTH([RaportPlik]) AS 'FileSize'
                      ,[RaportOpis]
                      ,[RaportDataOd]
                      ,[RaportDataDo]
FROM [Database]

, ( ..).

+1

varbinary (max) 2 . , , , DATALENGTH, , , .

+1

- " , , - , , , . , , , , , .

For guessing purposes, just the size of your image is a good approximation of the size of the line; The overhead of the row structure is negligible.

0
source

Source: https://habr.com/ru/post/1741961/


All Articles