Home All Groups Group Topic Archive Search About

Update an image column with new image from file

Author
19 Aug 2005 9:22 PM
dw
Hello...

I have a table that contains an Image column.  I will be receiving updates
from a user with some new images and I will need to update the table using
these new images (.jpg) format.

I looked at the BII utility...which looks great, but it only handles the
initial INSERT.  I need something similar to handle a Bulk Update too.  I
will need to read through all of the image files in a folder and, based on
their name (which is the primary key id for the table) I will update the
appropriate row.

Does anyone know of a way to do this?

thanks for any help.
- will

Author
20 Aug 2005 7:36 AM
John Bell
Hi

One way would be:

Write a batch file that you can pass the filename as a parameter.
In the batch file:
Call BII to load the passed filename into staging table
Use an osql command to execute a SQL Statement to update the main table from
the staging table using the file name in a where clause

Call the batch file by using something like:
FOR %i in (*) do CALL Mybatchfile %i

John

Show quote
"dw" <d*@discussions.microsoft.com> wrote in message
news:5727A3CD-31C0-4321-A48D-6C4378D5B85A@microsoft.com...
> Hello...
>
> I have a table that contains an Image column.  I will be receiving updates
> from a user with some new images and I will need to update the table using
> these new images (.jpg) format.
>
> I looked at the BII utility...which looks great, but it only handles the
> initial INSERT.  I need something similar to handle a Bulk Update too.  I
> will need to read through all of the image files in a folder and, based on
> their name (which is the primary key id for the table) I will update the
> appropriate row.
>
> Does anyone know of a way to do this?
>
> thanks for any help.
> - will
Author
20 Aug 2005 5:21 PM
dw
Hey....

Wow, that is a great idea. I will give it a try.

Thanks for your help.
- will

Show quote
"John Bell" wrote:

> Hi
>
> One way would be:
>
> Write a batch file that you can pass the filename as a parameter.
> In the batch file:
> Call BII to load the passed filename into staging table
> Use an osql command to execute a SQL Statement to update the main table from
> the staging table using the file name in a where clause
>
> Call the batch file by using something like:
> FOR %i in (*) do CALL Mybatchfile %i
>
> John
>
> "dw" <d*@discussions.microsoft.com> wrote in message
> news:5727A3CD-31C0-4321-A48D-6C4378D5B85A@microsoft.com...
> > Hello...
> >
> > I have a table that contains an Image column.  I will be receiving updates
> > from a user with some new images and I will need to update the table using
> > these new images (.jpg) format.
> >
> > I looked at the BII utility...which looks great, but it only handles the
> > initial INSERT.  I need something similar to handle a Bulk Update too.  I
> > will need to read through all of the image files in a folder and, based on
> > their name (which is the primary key id for the table) I will update the
> > appropriate row.
> >
> > Does anyone know of a way to do this?
> >
> > thanks for any help.
> > - will
>
>
>
Author
21 Aug 2005 5:35 AM
John Bell
That is without re-writing BII! As it is a sample application you do have
the source code.

John

Show quote
"dw" <d*@discussions.microsoft.com> wrote in message
news:8A8A0558-D157-4745-888D-C698172C4B6F@microsoft.com...
> Hey....
>
> Wow, that is a great idea. I will give it a try.
>
> Thanks for your help.
> - will
>
> "John Bell" wrote:
>
>> Hi
>>
>> One way would be:
>>
>> Write a batch file that you can pass the filename as a parameter.
>> In the batch file:
>> Call BII to load the passed filename into staging table
>> Use an osql command to execute a SQL Statement to update the main table
>> from
>> the staging table using the file name in a where clause
>>
>> Call the batch file by using something like:
>> FOR %i in (*) do CALL Mybatchfile %i
>>
>> John
>>
>> "dw" <d*@discussions.microsoft.com> wrote in message
>> news:5727A3CD-31C0-4321-A48D-6C4378D5B85A@microsoft.com...
>> > Hello...
>> >
>> > I have a table that contains an Image column.  I will be receiving
>> > updates
>> > from a user with some new images and I will need to update the table
>> > using
>> > these new images (.jpg) format.
>> >
>> > I looked at the BII utility...which looks great, but it only handles
>> > the
>> > initial INSERT.  I need something similar to handle a Bulk Update too.
>> > I
>> > will need to read through all of the image files in a folder and, based
>> > on
>> > their name (which is the primary key id for the table) I will update
>> > the
>> > appropriate row.
>> >
>> > Does anyone know of a way to do this?
>> >
>> > thanks for any help.
>> > - will
>>
>>
>>
Author
21 Aug 2005 4:54 PM
dw
Yes....I do have the sample BII from the SQL Server Resource Kit.

thanks again

Show quote
"John Bell" wrote:

> That is without re-writing BII! As it is a sample application you do have
> the source code.
>
> John
>
> "dw" <d*@discussions.microsoft.com> wrote in message
> news:8A8A0558-D157-4745-888D-C698172C4B6F@microsoft.com...
> > Hey....
> >
> > Wow, that is a great idea. I will give it a try.
> >
> > Thanks for your help.
> > - will
> >
> > "John Bell" wrote:
> >
> >> Hi
> >>
> >> One way would be:
> >>
> >> Write a batch file that you can pass the filename as a parameter.
> >> In the batch file:
> >> Call BII to load the passed filename into staging table
> >> Use an osql command to execute a SQL Statement to update the main table
> >> from
> >> the staging table using the file name in a where clause
> >>
> >> Call the batch file by using something like:
> >> FOR %i in (*) do CALL Mybatchfile %i
> >>
> >> John
> >>
> >> "dw" <d*@discussions.microsoft.com> wrote in message
> >> news:5727A3CD-31C0-4321-A48D-6C4378D5B85A@microsoft.com...
> >> > Hello...
> >> >
> >> > I have a table that contains an Image column.  I will be receiving
> >> > updates
> >> > from a user with some new images and I will need to update the table
> >> > using
> >> > these new images (.jpg) format.
> >> >
> >> > I looked at the BII utility...which looks great, but it only handles
> >> > the
> >> > initial INSERT.  I need something similar to handle a Bulk Update too.
> >> > I
> >> > will need to read through all of the image files in a folder and, based
> >> > on
> >> > their name (which is the primary key id for the table) I will update
> >> > the
> >> > appropriate row.
> >> >
> >> > Does anyone know of a way to do this?
> >> >
> >> > thanks for any help.
> >> > - will
> >>
> >>
> >>
>
>
>

AddThis Social Bookmark Button