Skip to content

Instantly share code, notes, and snippets.

@tomredsky
Created August 18, 2017 15:53
Show Gist options
  • Save tomredsky/f81349e3ed6942bf22a809414a63a1b6 to your computer and use it in GitHub Desktop.
Save tomredsky/f81349e3ed6942bf22a809414a63a1b6 to your computer and use it in GitHub Desktop.
SQL script to update contacts with dotmailer IDs
DROP TABLE IF EXISTS dm_temp;
CREATE TABLE dm_temp(
id int unique not null,
email varchar(256) unique not null,
status varchar(64)
);
COPY dm_temp FROM '/tmp/contacts.csv' WITH CSV;
BEGIN;
UPDATE mn set dotmailer_id=( select id from dm_temp where mn.eml=email);
COMMIT;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment