Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2003

    Red face Unanswered: Image data type Size

    I need to store images in MS SQL. I have the upload procedures and stuff but I'm missing the point about the image data type size.

    It is supposed to be able to store up to 2Gb!!! but when I declare the data field image I can't specify the max size for the field and by default is 16 !!

    16 bytes!! what can I do with that?
    How can I insert a file?

    Please help

  2. #2
    Join Date
    Sep 2005
    The pointer to the data is the only thing stored in this database row. The data is stored elsewhere and can be up to 2G. You don't get to specify the size.


  3. #3
    Join Date
    Oct 2003

    Red face How can I Insert Data?

    Thanks for the reply!

    But that leads me to this question: How can I write the Insert Statement for the image field?

    create table ImgTest (
    imgID Int,
    imgFName varchar(30),
    imgFType varchar(30),
    imgFile image

    All I got so far is a procedure in vb net that tryes to insert a byte array asigned to parameter value:

    Insert Into ImgTest Values (1, 'file.jpg', 'image file', @bytearray)

    That's where I'm having trouble because it returns the error: "Data will be truncated" or something like that. I guess it's because it tryes to store the file in the 16bytes that are reserved for the pointer...

    Oh.. I'm so lost..

    Thank you!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts