Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Query to find the size of data in a column

I have a column called RawData of datatype Image 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

like image 264
Derin Avatar asked Dec 27 '22 21:12

Derin


1 Answers

SELECT * FROM tbl WHERE DATALENGTH(RawData) > 1048576
like image 118
Nik Avatar answered Jan 15 '23 10:01

Nik