Skip to content

Fix trigger name extraction with ON in comment (#666)#668

Merged
erikdarlingdata merged 1 commit into
devfrom
fix/trigger-comment-on-666
Mar 23, 2026
Merged

Fix trigger name extraction with ON in comment (#666)#668
erikdarlingdata merged 1 commit into
devfrom
fix/trigger-comment-on-666

Conversation

@erikdarlingdata
Copy link
Copy Markdown
Owner

CHARINDEX for ON now starts after CREATE TRIGGER position, not from beginning of text.

CHARINDEX(N' ON ', st.text) searched from the start of the text,
so a comment like "Update Current LoadIndex Id on Machine record"
before CREATE TRIGGER would match first, producing a negative
SUBSTRING length.

Now passes the start position after CREATE TRIGGER as the third
argument to CHARINDEX so it only finds the ON clause after the
trigger name.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@erikdarlingdata erikdarlingdata merged commit 4757a4a into dev Mar 23, 2026
@erikdarlingdata erikdarlingdata deleted the fix/trigger-comment-on-666 branch April 9, 2026 00:34
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