Home
Paste
Show Key
Listed
Keep Editing
INSERT INTO myTable ( Name ) SELECT DISTINCT Name FROM ( VALUES ('Name 1'), ('Name 2') ) AS NewNames(Name) WHERE NOT EXISTS (SELECT 1 FROM TargetTable WHERE myTable.Name = NewNames.Name)
INSERT INTO myTable ( Name ) SELECT DISTINCT Name FROM ( VALUES ('Name 1'), ('Name 2') ) AS NewNames(Name) WHERE NOT EXISTS (SELECT 1 FROM TargetTable WHERE myTable.Name = NewNames.Name)