-
Notifications
You must be signed in to change notification settings - Fork 21
Add warning about varchar(max) #688
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Claude finished @mkincaid-bw's task —— View job PR Review: Add warning about varchar(max)Todo List
Review FeedbackThis PR adds a helpful warning section about ✅ Strengths
|
Deploying contributing-docs with
|
| Latest commit: |
0f3ffd2
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://ac5ce9de.contributing-docs.pages.dev |
| Branch Preview URL: | https://sql-varchar-max.contributing-docs.pages.dev |
|
Claude finished @mkincaid-bw's task —— View job PR Review: Add warning about varchar(max)
|
|
Great job! No new security vulnerabilities introduced in this pull request |
|
Claude finished @mkincaid-bw's task —— View job PR Review: Add warning about varchar(max)Todo List
Review FeedbackThis PR adds a helpful warning section about ✅ Strengths
✅ Technical AccuracyThe technical content is accurate:
✅ Content Quality
📝 Minor Observations
Overall AssessmentThis is a high-quality addition that addresses a common performance anti-pattern in SQL Server. The content is technically accurate, well-formatted, follows repository conventions, and provides clear, actionable guidance. The warning is appropriately placed where developers making schema changes would see it. Recommendation: ✅ Approve - This change improves the documentation by helping developers avoid a subtle but significant performance issue. |
withinfocus
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you share where not null max defaults are in use? I would honestly say there should never be a case where we do this and any calling code should be able to handle null values.
None of the current NOT NULL varchar(max)/nvarchar(max) columns have default constraints, but I was recently asked about adding a new nvarchar column with a default value to the User table. We have a fair amount of varchar(max)/nvarchar(max) (both NULL and NOT NULL) in the database, so I wanted to point out that when adding a new varchar/nvarchar column to a table, ideally it should be varchar(n)/nvarchar(n) vs varchar(max)/nvarchar(max), and the Contributing Docs didn't really address this. |
|
I'd suggest changing the language to state that defaults are not to be provided for strings then, plain and simple, and regardless of max being used. My personal opinion -- and I suppose this could be specified here too -- is that only integral types can utilize defaults, so practically speaking it's just bits and ints. |
|
Claude finished @mkincaid-bw's task —— View job PR Review: Add warning about varchar(max)Todo List
Review FeedbackThis PR has evolved significantly from its original varchar(max) focus to address a broader policy about string column defaults. Based on the discussion thread and the current implementation, here's my comprehensive review: ✅ Strengths
🎨 Technical AssessmentThe current warning states: Technical accuracy: ✅ Sound approach
📝 Alignment with Discussion ContextThe current implementation directly addresses the feedback from the PR discussion:
|


📔 Objective
Added clarification when adding new columns to a table using varchar(max)/nvarchar(max) vs varchar(n)/nvarchar(n), especially in regards to NOT NULL columns with default values.
⏰ Reminders before review
team
🦮 Reviewer guidelines
:+1:) or similar for great changes:memo:) or ℹ️ (:information_source:) for notes or general info:question:) for questions:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmedissue and could potentially benefit from discussion
:art:) for suggestions / improvements:x:) or:warning:) for more significant problems or concerns needing attention:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt:pick:) for minor or nitpick changes