Wednesday, September 19, 2007

Finding the Length of an Image Field in SQL 2005

Problem: I need to know the size in bytes of an image stored in an Image column in SQL 2005.

Solution: SELECT DATALENGTH(image) FROM schematicsimage WHERE [schematicsid] = 527

(Courtesy of Bruce the DBA)

3 comments:

  1. Thanks. this is most helpful,
    but do you know how to convert the lenght to actual byte size and hot to get the resolution of the image?

    ReplyDelete
  2. شكرا
    thanks
    نهاد
    nihad

    ReplyDelete