UPDATE
    TrackerNew.dbo.UnitCoreDetails 
SET
    [TrackerNew].[dbo].[UnitCoreDetails].Customer = [Tracker].[dbo].[UnitCoreDetails].Customer

FROM
    Tracker.dbo.UnitCoreDetails s
INNER JOIN
    [TrackerNew].[dbo].[UnitCoreDetails] i
ON
    i.[Serial] = s.[Serial]

This query results in the above error.

I thought it may be an alias problem but it does not seem to be, I have assigned aliases in the join and from clauses. Can anyone help?

有帮助吗?

解决方案

you do not want to fully qualify the column that you are updating:

UPDATE
    i 
SET
    Customer = s.Customer
FROM
    [TrackerNew].[dbo].[UnitCoreDetails] i
INNER JOIN
    Tracker.dbo.UnitCoreDetails s
ON
    i.[Serial] = s.[Serial]
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top