Try this instead
update m
SET LatestDate=B.LatestDate
FROM TableB B
INNER JOIN @Mytabvar m
ON m.id=B.ID
This is completely untested not having any table definitions and so forth.
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events