Question

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?

Was it helpful?

Solution

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]
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top