|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Wednesday, April 03, 2013 6:45 AM
Points: 19,
Visits: 73
|
|
Ok as a developer we are asked to develop systems that require back end storage in this scenario the system is SQL 2005 and the developer has created a field with nvarchar(50).
I have tested the input of the application and typed 50+ characters. When submitted to SQL the extra characters are simply dropped [(1)What is the offical name for this?]; My idea is to simply be smart enough to set the control to MaxLength = 50.
That way the End User sees the dropping of Characters.
What is the best practice.
Thanks all.
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Saturday, June 01, 2013 4:52 AM
Points: 2,556,
Visits: 2,590
|
|
moojjoo (5/12/2009) When submitted to SQL the extra characters are simply dropped [(1)What is the offical name for this?];
"Truncation"
moojjoo (5/12/2009)
What is the best practice.
Generally, its better to validate the input at the front end itself rather than accepting invalid data and avoiding the problems that may arise due to invalid data.
--Ramesh
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Wednesday, April 03, 2013 6:45 AM
Points: 19,
Visits: 73
|
|
SWEET!!!! SQL Server Central ROCKS!!!!!
This is my home for DB questions..................
|
|
|
|