What is the size of a image field content in SQL Server?

Fabio picture Fabio · Apr 4, 2012 · Viewed 51k times · Source

I have a table in SQL Server. This table has an image field and the application stores files in it.

Is there a way to read the size of the file in the image field using T-SQL?

Answer

Phil picture Phil · Apr 4, 2012
SELECT DATALENGTH(imagecol) FROM  table

See MSDN