Skip to content

Conversation

@SergeiPavlov
Copy link
Collaborator

@SergeiPavlov SergeiPavlov commented Dec 4, 2025

See https://mskb.pkisolutions.com/kb/316626
SQL Unique Constraint does not allow two NVARCHAR keys differing by trailing spaces

We have an issue because of this: https://servicetitan.atlassian.net/browse/STCRM-2615?focusedCommentId=2397077

SQL error details 'Type: UniqueConstraintViolation; Table: @p0_1; Value: (2134462427 );

Note the space after phone number "2134462427 "

@botinko
Copy link

botinko commented Dec 4, 2025

Is space in the beginning also needs to be trimmed?

@SergeiPavlov
Copy link
Collaborator Author

Is space in the beginning also needs to be trimmed?

No. SQL allows keys differing by leading spaces

@SergeiPavlov SergeiPavlov merged commit ee0509b into master-servicetitan Dec 4, 2025
38 checks passed
@SergeiPavlov SergeiPavlov deleted the trailingSpace branch December 4, 2025 22:17
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.

3 participants