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)
It is complaining because you are telling it to update this table/alias called `r` but this `r` is not found in the table name above.

You can rewrite the query to be this:

```
UPDATE r
SET r.[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')

```