Truncate data on insert with c#, sql sever

I have an asp.net form (c# code behind). The form allows users to insert and edit records. Once in a while a user will put in more data into a field than it can handle. This cause the truncated data error. What I would like to do is accept as much as possible from the field and insert that, truncating the rest of the data. Is there a way to do this? Either from the stored procedure or the c# code?
dodgerfanAsked:
Who is Participating?
 
dsackerContract ERP Admin/ConsultantCommented:
In the stored procedure, before where you update your tables, add:

SET ANSI_WARNINGS OFF

No more truncation error messages.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.