I'm getting the following error when executing this SQL script:
MERGE TridionCentres TridionCentres
USING (SELECT * FROM #CentresToUpdate) NewInfo
ON (TridionCentres.[publication id] = NewInfo.[publication id] AND
TridionCentres.centre_number = NewInfo.centre_number)
WHERE matched THEN
UPDATE
SET TridionCentres.centre = NewInfo.centre,
TridionCentres.[date] = NewInfo.[date];
Error:
Msg 156, Level 15, State 1, Line 5
Incorrect syntax near the keyword 'WHERE'.
I can't see where I've gone wrong!
The keyword is WHEN, not WHERE :)
More about it here, but a bit much to put into an answer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With