Skip to content

Support SQL Server SET IDENTITY_INSERT with a structured table target - #2605

Merged
manticore-projects merged 1 commit into
JSQLParser:masterfrom
minleejae:feat/sqlserver-set-identity-insert
Sep 12, 2026
Merged

manticore-projects merged 1 commit into
JSQLParser:masterfrom
minleejae:feat/sqlserver-set-identity-insert

Conversation

@minleejae

Copy link
Copy Markdown
Contributor

With Dialect.SQLSERVER, SET IDENTITY_INSERT [database.][schema.]table ON | OFF now parses into SetIdentityInsertStatement. Its editable target reuses the existing Table AST, including qualified and bracket-quoted names, and its ON/OFF value is separate from assignment expressions.

Both SQL renderers share statement formatting while table visitors retain context. Table discovery and metadata validation use the structured target, and feature analysis classifies the directive as a session setting. Generic SET assignments and other dialects retain their existing behavior.

Validation: full Gradle check passed (6,563 tests, 0 failures/errors, 25 skipped), covering AST edits, custom visitors/deparsers, metadata, invalid syntax, statement boundaries, and dialect isolation. The original Sakila insert-data script parses and round-trips all 46,326 statements, including 46,273 INSERTs and 26 IDENTITY_INSERT directives. The updated usage page builds with Sphinx warnings treated as errors.

Refs #1563. Syntax reference: Microsoft SET IDENTITY_INSERT.

@manticore-projects
manticore-projects merged commit 894ab4d into JSQLParser:master Sep 12, 2026
9 checks passed
@manticore-projects

Copy link
Copy Markdown
Contributor

Thank you!

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.

2 participants