Skip to content

fix: set SQL Server compatible default for insert batch size - #622

Open
danielkroeders wants to merge 2 commits into
dbt-labs:1.xfrom
danielkroeders:fix/sqlserver-insert-batch-size-limit
Open

danielkroeders wants to merge 2 commits into
dbt-labs:1.xfrom
danielkroeders:fix/sqlserver-insert-batch-size-limit

Conversation

@danielkroeders

Copy link
Copy Markdown

This is a:

  • bug fix PR with no breaking changes
  • new functionality

Description & motivation

SQL Server has a limitation of 1,000 row-value expressions per INSERT ... VALUES statement.

The default insert_batch_size configuration can exceed this limit, causing SQL Server to raise the following error when running the insert_resources_from_graph macro:

The number of row value expressions in the INSERT statement exceeds the maximum allowed number of 1000 row values. (10738)

This PR introduces adapter-specific defaults for insert_batch_size to prevent this issue:

  • Athena and BigQuery: 500
  • SQL Server: 1,000
  • Other adapters: 10,000

This ensures that generated INSERT statements respect SQL Server's row limit while retaining configurable batch sizes for other adapters.

Checklist

  • ./integration_tests_checks/run_checks.sh passes locally
  • I have updated the README.md and the documentation in docs/ (if applicable)
  • I have added or updated a case in integration_tests_checks/ and its expected_violations.csv (if applicable)

@danielkroeders
danielkroeders requested review from a team, b-per and graciegoheen as code owners November 7, 2026 13:04

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant