0
votes

My query is as shown below . I am getting error as

Msg 4104, Level 16, State 1, Procedure USP_Group11HtmlFileDetails, Line 71
The multi-part identifier "t_FI.Fullimage" could not be bound.

Msg 4104, Level 16, State 1, Procedure USP_Group11HtmlFileDetails, Line 71
The multi-part identifier "t_FI.Caption" could not be bound.

@tblGroup11HtmlFileImages is table variable which is of type exactly similar to ta

Query

UPDATE FI 
SET FI.Fullimage = t_FI.Fullimage, 
    FI.Caption  = t_FI.Caption
FROM tblGroup11HtmlFileImages FI 
WHERE EXISTS (SELECT * 
              FROM @tblGroup11HtmlFileImages t_FI 
              WHERE t_FI.[FileName] = FI.[FileName] 
                AND t_FI.Thumbnail = FI.Thumbnail)
1

1 Answers

2
votes

The exists operator only checks for existence of a value, no value is actually retrieved from the Exists operator.

You need to join these two tables something like....

UPDATE FI 
   SET  FI.Fullimage = t_FI.Fullimage
      , FI.Caption  = t_FI.Caption
FROM tblGroup11HtmlFileImages FI 
INNER JOIN @tblGroup11HtmlFileImages t_FI 
ON t_FI.[FileName] = FI.[FileName] 
AND t_FI.Thumbnail = FI.Thumbnail