Hello,
I would like to store some images in an msde table. When I go into the
enterprise manager design table mode and pick image as a field type, it
defaults to 16 bytes in size, and doesn't allow me to change the size. I
can't create a varbinary field greater than 8000 bytes either. The msde
instance is a recent install downloaded fresh from Microsoft, so it is the
current version (but for the life of me I can't figure out how to determine
the version #).
I've also tried using a shareware package called MSDE manager, but with the
same results.
How do I create an image field of 50K, for example?
thanks
Marc Pelletier
Hi,
It is not an issue, By default it will take bytes. Image data type will
allow you store a maximum of 2 GB. No need to change any thing
VARBINARY will allow a maximum of bytes.
Thanks
Hari
SQL Server MVP
"Marc Pelletier" <no.email@.please.com> wrote in message
news:Xns959A92CA0DCBAmpdd445@.216.168.3.44...
> Hello,
> I would like to store some images in an msde table. When I go into the
> enterprise manager design table mode and pick image as a field type, it
> defaults to 16 bytes in size, and doesn't allow me to change the size. I
> can't create a varbinary field greater than 8000 bytes either. The msde
> instance is a recent install downloaded fresh from Microsoft, so it is the
> current version (but for the life of me I can't figure out how to
> determine
> the version #).
> I've also tried using a shareware package called MSDE manager, but with
> the
> same results.
> How do I create an image field of 50K, for example?
> thanks
> Marc Pelletier
|||"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in news:eFR6PmUxEHA.1264
@.TK2MSFTNGP12.phx.gbl:
> It is not an issue, By default it will take bytes. Image data type will
> allow you store a maximum of 2 GB. No need to change any thing
> VARBINARY will allow a maximum of bytes.
>
I don't mean to look a gift horse in the mouth, but you haven't told me
anything. Do you mean to say that even though it appears to be 16 bytes, I
can actually stuff whatever I want in there? That doesn't seem likely.
cheers
Marc Pelletier
|||> I don't mean to look a gift horse in the mouth, but you haven't told me
> anything. Do you mean to say that even though it appears to be 16 bytes, I
> can actually stuff whatever I want in there? That doesn't seem likely.
Stop looking at enterprise manager to "tell you anything." The 16 bytes
represents a pointer to the data, not the actual data. Hari was not lying
when he said that you can store ~2 GB of data in there...
|||Typically, all that is stored in the data row for image, text, or ntext
columns is a 16 byte pointer to where the actual data is stored. You can
store up to 2GB of data for each data value using these data types.
For more information about how the data for these data types are stored,
see:
http://msdn.microsoft.com/library/?u...asp?frame=true
http://msdn.microsoft.com/library/?u...asp?frame=true
http://msdn.microsoft.com/library/?u...asp?frame=true
Alan Brewer [MSFT]
Content Architect
SQL Server Documentation Team
This posting is provided "AS IS" with no warranties, and confers no rights
|||"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in
news:#l6OeKbxEHA.2876@.TK2MSFTNGP12.phx.gbl:
> Stop looking at enterprise manager to "tell you anything." The 16
> bytes represents a pointer to the data, not the actual data. Hari was
> not lying when he said that you can store ~2 GB of data in there...
>
Ok, thanks, I didn't think he was lying ( and if I gave that impression,
sorry). That being the case, how come varbinary allows me to set the size
up to 8000, when it also has a limit of ~2G? How would I define my field
to store a large amount of data?
I'm guessing that under the hood they are essentially the same type,
since I could stream any binary data into an image field anyway, couldn't
I?
thanks
Marc Pelletier
|||> sorry). That being the case, how come varbinary allows me to set the size
> up to 8000, when it also has a limit of ~2G?
Who said varbinary has a limit of ~2 GB?
> How would I define my field
> to store a large amount of data?
Using the IMAGE datatype, not VARBINARY.
> I'm guessing that under the hood they are essentially the same type,
> since I could stream any binary data into an image field anyway, couldn't
> I?
I'm not going to presume to know exactly how the engine works with these
types. But I know that they are stored at least slightly differently,
similar to VARCHAR(8000) and TEXT (even though, deep down, they are both
just storing text).
|||"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in
news:O0zalzcxEHA.2568@.TK2MSFTNGP10.phx.gbl:
> Who said varbinary has a limit of ~2 GB?
>
Well... I did. But I shouldn't have. If it isn't clear already, I'm new to
sql server. I generally vigorously avoid database programming, but can't
avoid it for my current project.
Thanks for the help, everyone. I think I'm away for now.
Marc
|||Hello,
I am new to databases. But i dont understand how one could store a picture
in a cell in a database? Or do you mean that there is a link to the picture
in the cell?
Thanks
WStoreyII
"Marc Pelletier" wrote:
> Hello,
> I would like to store some images in an msde table. When I go into the
> enterprise manager design table mode and pick image as a field type, it
> defaults to 16 bytes in size, and doesn't allow me to change the size. I
> can't create a varbinary field greater than 8000 bytes either. The msde
> instance is a recent install downloaded fresh from Microsoft, so it is the
> current version (but for the life of me I can't figure out how to determine
> the version #).
> I've also tried using a shareware package called MSDE manager, but with the
> same results.
> How do I create an image field of 50K, for example?
> thanks
> Marc Pelletier
>
|||=?Utf-8?B?V1N0b3JleUlJ?= <WStoreyII@.discussions.microsoft.com> wrote in
news:54836FEC-DDCB-4F80-85F0-13F580D4C292@.microsoft.com:
> I am new to databases. But i dont understand how one could store a
> picture in a cell in a database? Or do you mean that there is a link
> to the picture in the cell?
>
WStorey,
The image is stored as a binary stream directly in a blob (binary large
object, I think ) field of the database. It adds a substantial overhead to
the process, and I think that in many cases it is better to store the image
on disk and store a reference to it in the db, as you have suggested.
However it is what I am going to do. In my case the number ( and size) of
images will be fairly small and dynamic, maybe a couple of thousand, and
will be accessed a lot, so I expext the sql server cacheing to help with
the performance hit.
The how is explained quite clearly in
http://support.microsoft.com/default...en-us;309158#1
for the csharp case.
Hope this helps.
Marc Pelletier
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment