What am I doing wrong for Image Insert?

  • Hi, Gurus..

    I want to insert images into SQL server. Eventually I want to create SP adn put into schedule job to load images at night..

    I was looking some hints and I found this but I got an error message when I used this from command prompt.

    Command:

    TEXTCOPY /S imis1 /U sa /P password /D iMIS_Train /T activity_attach /C ATTACH_IMAGE /W"where ATTACH_SEQN=647" /F \\testserver\CAGE\2005\20050727\050727A001\050727A0011.pdf /I /Z

    results:

    TEXTCOPY Version 1.0

    DB-Library version 8.00.194

      debug: Final parameters:

      debug:   Server: imis1

      debug:   Login: sa

      debug:   Password: password 

      debug:   Database: iMIS_Train

      debug:   Table: activity_attach

      debug:   Column: ATTACH_IMAGE

      debug:   Where clause: where ATTACH_SEQN=647

      debug:   File: \\testserver\CAGE\2005\20050727\050727A001\050727A0011.pdf

      debug:   Direction: Into SQL Server from file.

      debug:   Chunk size: 4096 bytes

    SQL Server 'IMIS1' Message 5701: Changed database context to 'master'.

    SQL Server 'IMIS1' Message 5701: Changed database context to 'IMIS_Train'. (Conc

    erning line 1)

      debug: Query: select ATTACH_IMAGE from activity_attach where ATTACH_SEQN=647

    ERROR: Text or image pointer and timestamp retrieval fail

     

    Therfore I also tried from Query Analyzer using this..

    xp_cmdshell 'TEXTCOPY /S imis1 /U sa /P imis12341 /D iMIS_Train /T activity_attach /C ATTACH_IMAGE /W"where ATTACH_SEQN=647" /F \\testserver\CAGE\2005\20050727\050727A001\050727A0011.pdf /I /Z'

    and I got this..

    'TEXTCOPY' is not recognized as an internal or external command,

    operable program or batch file.

    NULL

     

    What am I doing wrong

    Thx in advance

    Jay

     

     

  • Jay check books on line under the image data type. This should get you started. If you are still having problems post your DDLs, inset statements and the maximum size of the image data type.

    Mike

  • Thx..

    I just find out that if Image field is NULL, this TEXTCOPY wont work..

    Therefore I update that field with empty string('') and then I run this command.. That works OK..

     

    Thx

    Jay

     

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

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