dnlnln / generate-sql-merge

Generate SQL MERGE statements with Table data

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Merge statement fails when used for processing bigger tables

wimlauwaert opened this issue · comments

Issue:
The merge statement becomes too complex for MS SQL Server when dealing with bigger tables.

Suggestion:
Enable batch processing (@batchsize parameter) that does a merge per given batch size.

I just had a table with around 40K rows. It works, the trick is to set this:
MSSQL tools / options / query results / results to grix / xml data - Unlimited!

And to restart MSSQL Studio!

This issue is resolved by #94 and #101.

Usage:

EXEC [WideWorldImporters]..[sp_generate_merge] 
  @schema = 'Application', 
  @table_name='Cities', 
  @max_rows_per_batch = 5000,
  @delete_if_not_matched = 0

I just had a table with around 40K rows. It works, the trick is to set this: MSSQL tools / options / query results / results to grix / xml data - Unlimited!

And to restart MSSQL Studio!

image