Skip to content

timabell/sql-insert-trimmer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 

Repository files navigation

About

https://github.com/timabell/sql-insert-trimmer

Removes repeats of field list from insert scripts generated by visual studio data compare tool in the generating script file.

Based on https://gist.github.com/timabell/94b55a12db4c6ee42e10 takes generated SQL for INSERTing records en masse and strips repetition of column names modern sql server accepts multiple rows separated by commas in one insert block

Licence

MIT licenced - http://opensource.org/licenses/MIT

Before

INSERT (x,y,z) VALUES (1,2,3)
INSERT (x,y,z) VALUES (1,2,3)
INSERT (x,y,z) VALUES (1,2,3)

After

INSERT (x,y,z) VALUES
  (1,2,3)
, (1,2,3)
, (1,2,3)

It batches into blocks of 100 because sql server can only handle 1000 value rows at once, and there's a performance balance - http://stackoverflow.com/a/8640583/10245

Usage

sql-insert-trimmer.exe data-script.sql

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages