Query to find the size of data in a column
15,298
SELECT * FROM tbl WHERE DATALENGTH(RawData) > 1048576
Author by
Derin
Updated on November 20, 2022Comments
-
Derin over 1 year
I have a column called
RawData
of datatypeImage
in my table. I need to find all rows where the size of that column is more than 1 MB.It would be great if someone could help me with the query for this. I use SQL Server 2008.
Thanks in advance
-
Harry Joy almost 13 yearstry
datalength(field)
to get size of data and then compare it. -
marc_s almost 13 years
IMAGE
is deprecated since SQL Server 2005 - useVARBINARY(MAX)
instead
-