I have an SQL insert in SQL-Server that looks like this:
INSERT INTO Configuration.Localization ( languageid, localizationkey, localizationvalue) VALUES
(lang,'core.common.altered','(altered)'),
(lang,'core.common.cancel','Cancel'),
(lang,'core.common.ordernumber','Order number'),
(lang,'core.common.prefix','Prefix') ...
and so on.
How do I modify this query to use UPDATE
instead of insert (similarly to "ON DUPLICATE KEY UPDATE
" in MySQL), while keeping the overall structure of the query (I want it still to be one operator, not many).
Preferably I would like to be specific in the query, that UPDATE
must happen if lang
and localizationkey
both match.