Frage

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?

War es hilfreich?

Lösung

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]
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top