NOT IN
should work, but for something as simple as this, you could do something like:
INSERT INTO codes (code, value)
SELECT DISTINCT
code,
'' AS value
FROM @codes AS n
LEFT JOIN codes AS c
ON n.code = c.code
WHERE c.code IS NULL
Of course, it would be worthwhile to have a UNIQUE
constraint set on the table as well.