copy ima field from one record to another record

  • Can someone provides a T-SQL example to copy image field from one record in a table to another record in the same table?

    Thanks for the help.

  • Hi Allen,

    quote:


    Can someone provides a T-SQL example to copy image field from one record in a table to another record in the same table?


    take a look in BOL at Textcopy. It's a C++ example dealing with text and image data types. Although in its original version you are only able to pull and push in and out of SQL Server.

    Maybe TEXTPTR is also worth a try.

    BTW, I think it's easier writing a small VB app for this.

    Cheers,

    Frank

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

  • DECLARE @ptr_from varbinary(16)
    
    DECLARE @ptr_to varbinary(16)
    SELECT @ptr_from = TEXTPTR(columna) FROM tablea WHERE rowid = {fromid}
    SELECT @ptr_to = TEXTPTR(columna) FROM tablea WHERE rowid = {toid}
    UPDATETEXT tablea.columna @ptr_to 0 NULL tablea.columna @ptr_from

    Far away is close at hand in the images of elsewhere.
    Anon.

  • David, Thanks for the sample. It works great.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply