Skip to content

Instantly share code, notes, and snippets.

@kiichi
Last active March 25, 2020 16:48
Show Gist options
  • Save kiichi/0cca1eddd93f72afe3eefc11f8ee01a5 to your computer and use it in GitHub Desktop.
Save kiichi/0cca1eddd93f72afe3eefc11f8ee01a5 to your computer and use it in GitHub Desktop.
SQL Server Tips
MERGE Meetings target
USING (
VALUES ('2')
) AS source (uuid)
ON target.uuid = source.uuid
WHEN MATCHED THEN
UPDATE SET target.topic = 'updated'
WHEN NOT MATCHED THEN
INSERT (uuid, topic)
VALUES (source.uuid,'inserted')
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment