Search code examples
sqlsql-serverrowfilesizesqldatatypes

how to find the size of image in sql table?


i have an employee table and there is a column for photo.

1 )Can i check the total size of the column for all images ? 2) How to find the size of each employees pic size ?

Regards


Solution

  • You can use the below code for finding the the size of the employees pic

    SELECT DATALENGTH(imagecol) FROM employee group employeeID

    for finding the total size you can go for sum

    SELECT SUM(DATALENGTH(imagecol)) FROM  employee