Wednesday, March 28, 2012

Images in SQL

I notice that SQL 2000 has a datatype of image.
My question is after I setup the table and fields how do I populate the
table with image data?Look up the usage and example of statements UPDATETEXT and WRITETEXT in SQL
Server Books Online.
Anith|||I looked those up and they just give examples of writing text to the fields.
I would like to know how to add a picture to the field.
"Anith Sen" <anith@.bizdatasolutions.com> wrote in message
news:OoEv9%23glGHA.4444@.TK2MSFTNGP02.phx.gbl...
> Look up the usage and example of statements UPDATETEXT and WRITETEXT in
> SQL Server Books Online.
> --
> Anith
>|||Image and nText fields are binary fields, like the old BLOB (binary large
object) fields.
To write an image into thsee fields you need to serialize the data into eith
er a
stream or use ADO or ADO.Net
A better question back to you is how and when do you want to get the picture
s
into the database?
Alternatively, you may wish to simply store the images somewhere and use a p
ath
to the raw image files, there are benefits and costs for both methods, in th
e
database or a pointer to a file.
HTH
JeffP...
<Preacher Man> wrote in message news:udRf$ChlGHA.4772@.TK2MSFTNGP04.phx.gbl...
> I looked those up and they just give examples of writing text to the field
s.
> I would like to know how to add a picture to the field.
>
> "Anith Sen" <anith@.bizdatasolutions.com> wrote in message
> news:OoEv9%23glGHA.4444@.TK2MSFTNGP02.phx.gbl...
>|||I am trying to write a simple application for printing employee badges. I
have VFP 9.0 that I will be using as the application writer.
Any ideas on how I should enter these images into the database? I can use a
VFP table or SQL is doesn't really matter to me in this case.
A path to the filename would be fine for me to use also, but how would I
implement that into a form?
Thanks for any info.
"JDP@.Work" <JPGMTNoSpam@.sbcglobal.net> wrote in message
news:%23cB$WUhlGHA.4792@.TK2MSFTNGP02.phx.gbl...
> Image and nText fields are binary fields, like the old BLOB (binary large
> object) fields.
> To write an image into thsee fields you need to serialize the data into
> either a
> stream or use ADO or ADO.Net
> A better question back to you is how and when do you want to get the
> pictures
> into the database?
> Alternatively, you may wish to simply store the images somewhere and use a
> path
> to the raw image files, there are benefits and costs for both methods, in
> the
> database or a pointer to a file.
> HTH
> JeffP...
>
> <Preacher Man> wrote in message
> news:udRf$ChlGHA.4772@.TK2MSFTNGP04.phx.gbl...
>|||Sorry, I'm out of the loop on VFP since 3.2... but google this...
image data into SQL
HTH
JeffP...
<Preacher Man> wrote in message news:%23pQTiXhlGHA.3740@.TK2MSFTNGP02.phx.gbl...ed">
> I am trying to write a simple application for printing employee badges. I
> have VFP 9.0 that I will be using as the application writer.
> Any ideas on how I should enter these images into the database? I can use
a
> VFP table or SQL is doesn't really matter to me in this case.
> A path to the filename would be fine for me to use also, but how would I
> implement that into a form?
> Thanks for any info.
> "JDP@.Work" <JPGMTNoSpam@.sbcglobal.net> wrote in message
> news:%23cB$WUhlGHA.4792@.TK2MSFTNGP02.phx.gbl...
>|||Here is an article that I wrote about storing and retrieving images from SQL
Server that might help:
http://www.dbazine.com/sql/sql-articles/larsen13
"Preacher Man" wrote:

> I notice that SQL 2000 has a datatype of image.
> My question is after I setup the table and fields how do I populate the
> table with image data?
>
>|||See if this helps:
http://groups.google.com/groups/sea...lum
n%22
Steve Kass
Drew University
Preacher Man wrote:

>I notice that SQL 2000 has a datatype of image.
>My question is after I setup the table and fields how do I populate the
>table with image data?
>
>|||I would store them in the filesystem, as suggested. Using the IMAGE
datatype is more of a hassle than it's worth. Here's an article describing
some of the ups and downs: http://www.aspfaq.com/show.asp?id=2149. If you
stored the path to the filename in a VARCHAR column, you would retrieve the
image by filename in your front-end application. I'm not familiar with VFP
9, so I couldn't give you specific advice on that, but I can almost
guarantee it would be easier than using TEXTPTR and READTEXT! :)
<Preacher Man> wrote in message
news:%23pQTiXhlGHA.3740@.TK2MSFTNGP02.phx.gbl...
>I am trying to write a simple application for printing employee badges. I
>have VFP 9.0 that I will be using as the application writer.
> Any ideas on how I should enter these images into the database? I can use
> a VFP table or SQL is doesn't really matter to me in this case.
> A path to the filename would be fine for me to use also, but how would I
> implement that into a form?
>

No comments:

Post a Comment