Home All Groups Group Topic Archive Search About

how to insert picture into a table

Author
9 Sep 2005 2:52 PM
Britney
how do I do that?
can I do this in query analyzer?

Author
9 Sep 2005 3:24 PM
Jens Süßmeyer
Depends on your coding language, you should check in google for stream
+upload +sql server +<yourcodinglanguage>

Or just write your coding language here, perhaps we can provide you with
some interesting links.

HTH, Jens Suessmeyer.

---
http://www.sqlserver2005.de
---


Show quote
"Britney" <britneychen_2***@yahoo.com> wrote in message
news:OHvwa4UtFHA.1444@TK2MSFTNGP10.phx.gbl...
> how do I do that?
> can I do this in query analyzer?
>
>
Author
9 Sep 2005 3:38 PM
Britney
my table pictures is empty.

CREATE TABLE [dbo].[pictures] (
[pid] [int] NULL ,
[picture] [image] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO


I use textcopy.exe in dos environment, but I got error.
WHAT HAPPEN?  I don't understand ERROR: Row retrieval failed.
I want to insert it, not update it.  does that mean textcopy.exe only do
update?



TEXTCOPY Version 1.0
DB-Library version 8.00.2039
Type the SQL Server to connect to:  LOCALW
Type your login: brit
Type your password: brit
Type the database: Northwind
Type the table: pictures
Type the text or image column: picture
Type the where clause: where 1=1
Type the file: C:\teaser_head2.jpg
Type the direction ('I' for in, 'O' for out): I
ERROR: Row retrieval failed.


Show quote
"Jens Süßmeyer" <Jens@remove_this_for_contacting_sqlserver2005.de> wrote in
message news:OF28HKVtFHA.3236@TK2MSFTNGP14.phx.gbl...
> Depends on your coding language, you should check in google for stream
> +upload +sql server +<yourcodinglanguage>
>
> Or just write your coding language here, perhaps we can provide you with
> some interesting links.
>
> HTH, Jens Suessmeyer.
>
> ---
> http://www.sqlserver2005.de
> ---
>
>
> "Britney" <britneychen_2***@yahoo.com> wrote in message
> news:OHvwa4UtFHA.1444@TK2MSFTNGP10.phx.gbl...
>> how do I do that?
>> can I do this in query analyzer?
>>
>>
>
>
Author
9 Sep 2005 4:01 PM
Britney
Jen,
    I don't want to use coding language such as C# or java to insert
picture,
I only want to use SQL build-in utility and/or straight SQL query to do
that.  so I don't think textcopy is an option since it only does update.






Show quote
"Jens Süßmeyer" <Jens@remove_this_for_contacting_sqlserver2005.de> wrote in
message news:OF28HKVtFHA.3236@TK2MSFTNGP14.phx.gbl...
> Depends on your coding language, you should check in google for stream
> +upload +sql server +<yourcodinglanguage>
>
> Or just write your coding language here, perhaps we can provide you with
> some interesting links.
>
> HTH, Jens Suessmeyer.
>
> ---
> http://www.sqlserver2005.de
> ---
>
>
> "Britney" <britneychen_2***@yahoo.com> wrote in message
> news:OHvwa4UtFHA.1444@TK2MSFTNGP10.phx.gbl...
>> how do I do that?
>> can I do this in query analyzer?
>>
>>
>
>
Author
9 Sep 2005 4:48 PM
Louis Davidson
You can simply use DDL:

CREATE TABLE [dbo].[pictures] (
[pid] [int] NULL ,
[picture] [image] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

insert into pictures
values (1,0x000000000101020201010)

So that part is easy.  The hard bit is that you have to take your image and
turn it into the hexidecimal format.  Can't help you there, I regret.

--
----------------------------------------------------------------------------
Louis Davidson - http://spaces.msn.com/members/drsql/
SQL Server MVP
"Arguments are to be avoided: they are always vulgar and often convincing."
(Oscar Wilde)

Show quote
"Britney" <britneychen_2***@yahoo.com> wrote in message
news:%238hiZfVtFHA.3080@TK2MSFTNGP15.phx.gbl...
> Jen,
>    I don't want to use coding language such as C# or java to insert
> picture,
> I only want to use SQL build-in utility and/or straight SQL query to do
> that.  so I don't think textcopy is an option since it only does update.
>
>
>
>
>
>
> "Jens Süßmeyer" <Jens@remove_this_for_contacting_sqlserver2005.de> wrote
> in message news:OF28HKVtFHA.3236@TK2MSFTNGP14.phx.gbl...
>> Depends on your coding language, you should check in google for stream
>> +upload +sql server +<yourcodinglanguage>
>>
>> Or just write your coding language here, perhaps we can provide you with
>> some interesting links.
>>
>> HTH, Jens Suessmeyer.
>>
>> ---
>> http://www.sqlserver2005.de
>> ---
>>
>>
>> "Britney" <britneychen_2***@yahoo.com> wrote in message
>> news:OHvwa4UtFHA.1444@TK2MSFTNGP10.phx.gbl...
>>> how do I do that?
>>> can I do this in query analyzer?
>>>
>>>
>>
>>
>
>
Author
9 Sep 2005 6:05 PM
Britney
One way to hack around it is to initialize row for textcopy and then update
picture in that row using textcopy.exe
so when you do select picture from the table, you 'll see hexidecimal code.

unfortunately, I can't set image to a local variable in sql server.  I guess
I can't avoid application programming then.

thanks




Show quote
"Louis Davidson" <dr_dontspamme_sql@hotmail.com> wrote in message
news:efRiZ5VtFHA.1168@TK2MSFTNGP10.phx.gbl...
> You can simply use DDL:
>
> CREATE TABLE [dbo].[pictures] (
> [pid] [int] NULL ,
> [picture] [image] NULL
> ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
> GO
>
> insert into pictures
> values (1,0x000000000101020201010)
>
> So that part is easy.  The hard bit is that you have to take your image
> and turn it into the hexidecimal format.  Can't help you there, I regret.
>
> --
> ----------------------------------------------------------------------------
> Louis Davidson - http://spaces.msn.com/members/drsql/
> SQL Server MVP
> "Arguments are to be avoided: they are always vulgar and often
> convincing." (Oscar Wilde)
>
> "Britney" <britneychen_2***@yahoo.com> wrote in message
> news:%238hiZfVtFHA.3080@TK2MSFTNGP15.phx.gbl...
>> Jen,
>>    I don't want to use coding language such as C# or java to insert
>> picture,
>> I only want to use SQL build-in utility and/or straight SQL query to do
>> that.  so I don't think textcopy is an option since it only does update.
>>
>>
>>
>>
>>
>>
>> "Jens Süßmeyer" <Jens@remove_this_for_contacting_sqlserver2005.de> wrote
>> in message news:OF28HKVtFHA.3236@TK2MSFTNGP14.phx.gbl...
>>> Depends on your coding language, you should check in google for stream
>>> +upload +sql server +<yourcodinglanguage>
>>>
>>> Or just write your coding language here, perhaps we can provide you with
>>> some interesting links.
>>>
>>> HTH, Jens Suessmeyer.
>>>
>>> ---
>>> http://www.sqlserver2005.de
>>> ---
>>>
>>>
>>> "Britney" <britneychen_2***@yahoo.com> wrote in message
>>> news:OHvwa4UtFHA.1444@TK2MSFTNGP10.phx.gbl...
>>>> how do I do that?
>>>> can I do this in query analyzer?
>>>>
>>>>
>>>
>>>
>>
>>
>
>

AddThis Social Bookmark Button