Skip to content

Instantly share code, notes, and snippets.

@bsa7
Last active December 31, 2015 10:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bsa7/7971206 to your computer and use it in GitHub Desktop.
Save bsa7/7971206 to your computer and use it in GitHub Desktop.
sql bulk-insert syntax
Instead n queries as:
insert into table_name (id, val) values(1,1);
insert into table_name (id, val) values(1,2);
insert into table_name (id, val) values(1,3);
...........................................
insert into table_name (id, val) values(1,n);
we can do one query as:
insert into table_name (id, val) values(1,1),(2,2),(3,3),…(n,n)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment