Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 SQL UPDATE problem....Help!!

Author  Topic 

KnooKie
Aged Yak Warrior

623 Posts

Posted - 2001-02-19 : 10:17:13
The following code is meant to update a field based on the condition of the 3 fields in the where clause, however, the 3 fields in the WHERE clause are in a different database to the fields being updated and i get the following error message when i try to run this:

Server: Msg 107, Level 16, State 1, Line 1
The column prefix 'iData_Holding..FMG_Address' does not match with a table name or alias name used in the query.

if i remove the WHERE clause everything is fine, so how can i include the WHERE clause within this statement please ??


UPDATE
Proteus..tbl_Inst_Address
SET
fi_iData_AddressCode = (SELECT FMG_Address_Code FROM iData_Holding..FMG_Address
WHERE FMG_Address_Code = Proteus..tbl_Inst_Address.fi_iData_AddressCode)
WHERE
iData_Holding..FMG_Address.FMG_Address_Status = 2
AND
iData_Holding..FMG_Address.Upload_Status_Code = 'U'
AND
iData_Holding..FMG_Address.Active = 1



I am using SQL2K on an NT client machine.

many thanks

   

- Advertisement -