Dear all,
I was just wondering: Can you change the default behaviour as illustrated below?
The user passes a longer string than it was defined in the proc parameter and may not get a feedback, that the string was not processed as he/she wanted. (e.g. when inserting the value into a table)
create procedure prp
@x varchar(1)
as select @x
exec prp @x='x' -- => x
exec prp @x='xy' -- => x
I'm absolutely not new to MSSQL, but funnily I never thought that this could be a problem 🙂
Best Regards
Arthur
If you search other forums, you will see that this is commonly known as the 'silent truncation issue'. The most common workarounds appear to be as follows:
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
May 7, 2024 at 12:00 pm
Thanks a ton!
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply