Question: ```
update [RegistryCopy].[dbo].[RegFile_New]
SET r.[FileNo] = v.[Cont#Account (New ACC)]
where r.[FileNo] IN
    (
    SELECT r.[FileNo]
    FROM [RegistryCopy].[dbo].[RegFile_New] as R
    INNER JOIN
    [Registry_Malta_Recovered].[dbo].OLD_NEW_AccountsFromSap as v ON 
     r.FileNo] = v.[Acct in legacy (Old ACC)]
      where 
      r.[FileNo] = ('1000040000')
     )

```

I'm getting the error message:

> 
> The multi-part identifier "r.FileNo" could not be bound.
> 
> 
>

Answer: 
It seems that "r" and "v" identifiers are available for the sub-query only. 

Please try to use `UPDATE FROM` syntax as it was done here:
[Update a table using JOIN in SQL Server?](https://stackoverflow.com/questions/1604091/update-a-table-using-join-in-sql-server)
Your statement is invalid. You're referring to aliases in the outer query that are defined in the inner query (subquery), and you're also referring to fields in the outer query for tables that are only defined in the inner query.

This is the closest approximation of your query:

```
UPDATE r
SET [FileNo] = v.[Cont#Account (New ACC)]
FROM [RegistryCopy].[dbo].[RegFile_New] AS R
INNER JOIN [Registry_Malta_Recovered].[dbo].OLD_NEW_AccountsFromSap AS v
    ON r.[FileNo] = v.[Acct in legacy (Old ACC)]
WHERE r.[FileNo] = ('1000040000')

```