String Max Length issue - Execute DDL commands

0
Hi, I have an issue where I want to set the max length of a String Attribute to 10000 characters. However, I get Execute DDL commands error message and the following: Caused by: com.mendix.systemwideinterfaces.connectionbus.ConnectionBusException: Error (SQL State: S0003, Error Code: 131) on executing: UPDATE [risks$riskemailcontext]  SET [message] = CAST([690cf3437ca54af89c0d5f81fa165f50] AS nvarchar(10000)) All changes are rolled back.     at com.mendix.connectionbus.modelsynchronization.DDLCommandExecutor.execute(DDLCommandExecutor.java:77) Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The size (10000) given to the type 'nvarchar' exceeds the maximum allowed for any data type (8000).     However, if I set the value to 7999 for example it will throw the same error saying that the maximum allowed for any data type is 4000. Moreover, if I choose to set it to Unlimited it will throw the same error message choosing the last value that was inputted in the Limited box.  Could you please let me know what to do if I want to store an email message body in this string attribute that has more than 6000 characters? Kind regards, Razvan
asked
4 answers
1

“Nice” to see that 3 years later this is still not solved. I have the same problem. I'll migrate my strings to another attribute.

answered
0

Razvan,

You could try deleting the attribute, starting your app, then adding the attribute back after the app has started.  Sounds to me like you have a database issue with this attribute.  I had a similar issue recently and deleting and re-adding the attribute corrected it for me.  This assumes that you don't have any data in that attribute.

Mike

answered
0

Mendix 6.8.1 and SQL Server 2012

answered
0

This seems to be a SQL server limitation when specifying the max. length of a String attribute. According to several topics I found (link) the solution would be to go for MAX, which I'm guessing means setting the length to Unlimited?

answered