Skip to content

A text command's AddParam(value) and AddParams(object) use the @name markers in its SQL - #92

Merged
electricessence merged 1 commit into
masterfrom
split/05-sql-text-names
Nov 9, 2026
Merged

electricessence merged 1 commit into
masterfrom
split/05-sql-text-names

Conversation

@electricessence

Copy link
Copy Markdown
Collaborator

For a text command the library sent each argument under the name written in code, even when the SQL declared a different parameter (for example @company_serial_num for CompanySerialNum), so the value never reached the query.

The SQL text is now scanned for @name markers, skipping strings, quoted identifiers, comments and @@system variables. Arguments are matched to them the way stored procedure parameter names already are. A text command with no marker keeps the old behaviour.

See it in the tests: SqlTextParametersTests (the scanner), SqlTextDerivedNamesTests (commands) and the six updated cases in DerivedParameterNameTests.

Verified: 8844 tests pass in Release and Debug, 0 build warnings, 86 sample checks, style and analyzers 0 findings.

🤖 Generated with Claude Code

…m the @name markers in its SQL text

Previously a text command sent each argument under the name it was written with, even when the SQL declared a different parameter. The SQL text is now scanned for @name markers (not those inside strings, quoted identifiers or comments, and not @@System variables) and arguments are matched to them the way stored procedure parameters are.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@electricessence
electricessence merged commit d07af8f into master Nov 9, 2026
2 checks passed
@electricessence
electricessence deleted the split/05-sql-text-names branch November 9, 2026 16:45
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