Make INSERT statements more efficient using shorter SQL
The INSERT statements that Data Compare should take advantage of the shorten INSERT syntax. For example.
--USE THIS
INSERT INTO dbo.AgiisErrorCode
( Error_Code, Description )
VALUES ( '1', 'Test' ),
( '2', 'test2' ),
( '3', 'test3' )
I--nstead of.....
INSERT INTO dbo.AgiisErrorCode
( Error_Code, Description )
VALUES ( '1', 'Test' )
INSERT INTO dbo.AgiisErrorCode
( Error_Code, Description )
VALUES ( '2', 'test2' )
INSERT INTO dbo.AgiisErrorCode
( Error_Code, Description )
VALUES ( '3', 'test3' )
The .SQL files will be smaller, use less network bandwidth, and arguably, insert faster.
Thanks!
-
Claudio commented
SSMS has serious memory limitations when dealing with large scripts. Making smaller scripts is a must.
-
Gerald Britton commented
Yes! Badly needed. How did this languish 4+ years?
-
Tim Abell commented
I wrote a tool to tidy up the generated files: https://github.com/timabell/sql-insert-trimmer
@redgate, if you implement this watch out for the performance cliff! http://stackoverflow.com/a/8640583/10245 would be good to work out the optimal number of value lines depending on the number of columns.