dcsimg
Results 1 to 2 of 2

Thread: BULK UPDATE error

  1. #1
    Join Date
    Dec 2011
    Posts
    1

    BULK UPDATE error

    I would like to update my table from external data. My SQL 2005 query is like: UPDATE table1 SET Photo = (SELECT *FROM OPENROWSET(BULK 'C:\Photo\photo1.jpg', SINGLE BLOB) AS Photo) WHERE EmployeeID = 0001
    For some reasons some photos are missing from the directory and I would like to skip when executing the next UPDATE statement but the query stop after getting the error. Msg 4860, Cannot bulk load. The file "C:\Photo\photo1.jpg" does not exist. Any help to skip the error and move to next row?

  2. #2
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,918
    Can you put an IF statement to check if file exists then only execute UPDATE?

    You can use xp_getfiledetails.

Posting Permissions

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