0

While saving my record form C# to LocalDB, my strings get truncated although I am using NVarChar(Max) as column type.

Any Suggestions to fix this?

Saeedses
  • 109
  • 1
  • 1
  • 8
  • see http://stackoverflow.com/questions/11131958/what-is-the-maximum-characters-for-the-nvarcharmax – Georg Patscheider Jun 29 '16 at 09:30
  • Fix what? You haven't posted the code that shows the problem. If the data was too long you'd get an exception, not truncation – Panagiotis Kanavos Jun 29 '16 at 09:30
  • 1
    "max indicates that the maximum storage size is 2^31-1 bytes (2 GB)" - are you sure your strings are being truncated on the DB, not by parameter coercion etc? – stuartd Jun 29 '16 at 09:30
  • already answered. http://stackoverflow.com/questions/11131958/what-is-the-maximum-characters-for-the-nvarcharmax – ilan danielov Jun 29 '16 at 09:31
  • 1
    Also, people frequently mistake what the *client tools* do with long values (often truncating them for display purposes with no indication that this has occurred) rather than understanding that the entire value *is* present in the underlying table and *is* retrievable, just not when using the ad-hoc querying tools. – Damien_The_Unbeliever Jun 29 '16 at 09:33
  • 1
    @Stanley the answer says *NOT* 4000. It's 2GB – Panagiotis Kanavos Jun 29 '16 at 09:52

0 Answers0