I still didn't get what you are trying to do, so these may or may not be right.
if not exists (select * from dbo.TableB where @ItemId = ItemID)
delete from dbo.TableA where @ItemID = ItemID
a.ItemID = @ItemID
and not exists (select * from TableB b where b.ItemID = a.ItemID);