SQL server image data

  • Thread starter Thread starter John
  • Start date Start date
J

John

Hi! Guys,
May be this question is little stupid but I want to clarify this.
Let suppose I have image data field in Sql server 2000 and I am uploading
an image of 10KB(thru asp.net application).
What would be the size for that table with image data field ?
Is it 10KB or less than 10KB or more than 10KB ?

Thanks
John
www.e-classifiedad.com
 
John said:
Hi! Guys,
May be this question is little stupid but I want to clarify this.
Let suppose I have image data field in Sql server 2000 and I am uploading
an image of 10KB(thru asp.net application).
What would be the size for that table with image data field ?
Is it 10KB or less than 10KB or more than 10KB ?

Thanks
John
www.e-classifiedad.com

Greater than 10KB, because there will be some table metadata (and I'm
assuming you have other columns in the table also). And possibly a lot more,
if you include any indexes on other columns.

Simon
 
To check the size of the image column use data_legnth(<colname>). If
this column is the content of the file then the data_length(<colname>)
should be same as file size. The winodws explorer rounds the size upto
the nearest KB. You can click on the file properties to see the actual
bytes. Hope this helps.

Thanks
 
The SQL Server online documentation states that the image data type can hold 0 to 2,147,483,647 bytes

Variable-length binary data from 0 through 2,147,483,647 byte

The 10 kb image will be 10240 bytes in length, so will fit without any problems into this field. In table designer you only seem to be able to specify that a field be of type image and not vary the length of it. So looks like, someone correct me if I am wrong, whether you stores a 1kb image or a 50kb image in an image field SQL Server will always allocate 2,147,483,647 byets for it

Rasika Wijayaratne
 
Back
Top