You are here: Sum of Column of Blob type « MsSQL Server « IT news, forums, messages
Sum of Column of Blob type

Posted by Connie on 04/10/07 19:46

I have a column in my table that is an Image (blob). The data stored
in this blob is basically pdf files. I need a query to determine the
total size of these blob's in the database. Here is what is
happening, if I run it as below I get 23736000 for a result.

select sum(datalength (cast(document AS binary(8000)))) from
plan_report

If I run it like this select sum(datalength (cast(document AS
varbinary(8000)))) from plan_report
I get 23736000 also as a result

If I run it like this select sum(datalength (cast(document AS
varbinary))) from plan_report
I get 89010 this as a result

If I run this: select datalength(document) from plan_report then I
get a result for each row and when I sum those rows I get 5584452854
this as a result.

I do not believe the first 3 queries are returning correct result sets
due to the limit on the fields (binary/varbinary) and since this is an
image field I cannot convert to anything else.....

I am out of ideas, and any help you can give me will be greatly
appreciated...

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация