Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2003
    Posts
    4

    Unanswered: Moving Image data from one table to another

    I need to move image data that is loaded into one table from that table to another. A normal update doesnt seem to work properly. I am fairly new to manipulating BLOBs can someone point me in the right direction? The closest that I can come to a solution is to extract the image to a file then reload it in to the new table.

    TIA

  2. #2
    Join Date
    Feb 2003
    Posts
    4
    Nm I found it

    Snippet below

    Declare @tpDest as varbinary(16)
    Declare @tpSource as varbinary(16)
    Declare @byteCount as Integer

    Select @tpSOurce = TEXTPTR(imgImages), @byteCOunt = DataLength(imgImages) From tblScannedForm Where ScannedFOrmSID = @ID
    Select @tpDest = TEXTPTR(imgCACImage) from tblCustActivationCards Where CustActivationCArdID = IDENT_CURRENT('tblCustActivationCards')
    UPDATETEXT tblCustActivationCards.imgCACImage @tpDest 0 0 tblScannedForm.imgImages @tpSource

  3. #3
    Join Date
    Nov 2003
    Posts
    15
    Hi, I m pretty new to this image stiff in SQL2000. I tried your code snippet but my SP kept prompting me 'NULL textptr (text, ntext, or image pointer) passed to UpdateText function' whenever I tried. Could you advise? Thanks!


    Originally posted by mvillaronga
    Nm I found it

    Snippet below

    Declare @tpDest as varbinary(16)
    Declare @tpSource as varbinary(16)
    Declare @byteCount as Integer

    Select @tpSOurce = TEXTPTR(imgImages), @byteCOunt = DataLength(imgImages) From tblScannedForm Where ScannedFOrmSID = @ID
    Select @tpDest = TEXTPTR(imgCACImage) from tblCustActivationCards Where CustActivationCArdID = IDENT_CURRENT('tblCustActivationCards')
    UPDATETEXT tblCustActivationCards.imgCACImage @tpDest 0 0 tblScannedForm.imgImages @tpSource

  4. #4
    Join Date
    Sep 2003
    Posts
    522
    update tblCustActivationCards set imgCACImage = null where CustActivationCArdID = IDENT_CURRENT('tblCustActivationCards')
    Select @tpDest = TEXTPTR(imgCACImage) from tblCustActivationCards Where CustActivationCArdID = IDENT_CURRENT('tblCustActivationCards')
    UPDATETEXT tblCustActivationCards.imgCACImage @tpDest 0 0 tblScannedForm.imgImages @tpSource

  5. #5
    Join Date
    Nov 2003
    Posts
    15
    Thanks for your help!

    Originally posted by ms_sql_dba
    update tblCustActivationCards set imgCACImage = null where CustActivationCArdID = IDENT_CURRENT('tblCustActivationCards')
    Select @tpDest = TEXTPTR(imgCACImage) from tblCustActivationCards Where CustActivationCArdID = IDENT_CURRENT('tblCustActivationCards')
    UPDATETEXT tblCustActivationCards.imgCACImage @tpDest 0 0 tblScannedForm.imgImages @tpSource

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •