Varchar(Max) MSSQL FireDac


I want to update a database field of type varchar(max).
For modelling I use TMS Data Modeler Application. In delphi (XE8) I use the MSSql native driver and
the appropriate units and  for db acces I use FireDac.
If the string size now exceeds 8002 bytes I get the exception:

EFDExpection with message'[FireDac][Phys][ODBC]-345.
Data too large for variable [A_HTML]. Max len =[8002], actual len = [8445]
Hint : Set the TFDParamSize to a greater value.

I've tried to set the column attribute manually to a value higher than 8445 for example 65535 but this won't help.

In case of pure FireDac access with FDQuery etc. it's possible to set the param.size property to a higher value but as researched in forums this will not help in any cases.

Any suggestions how I can solve this issue?


      -René Höger

I believe your database column is being created as Varchar(8002)? 

What is the exact datatype of that column in database?
What is the exact [Column] mapping you have in Aurelius for that property?
Note that if the property is a string, to treat it as a memo you must set the column size to a value higher than 65535, so 65536 might do the job.


The database column is created as Varchar(Max).
When I look in the sql manager on the appropriate column I see Html (varchar(max), NULL).
And I changed the column attribute to '[Column('Html', [], 65535)]'
The propery is a Nullable<string>.

With '[Column('Html', [], 65536)]' it worked!
But don't it must work automatically. So I have to go to the source and everytime I create a new source
I must change it!? Maybe you can put a property to the TMS Data Modeler?
Or is there another way?


        -René Höger

We have just released a new version of Data Modeler that adds the [DBTypeMemo] attribute in those cases. This attribute is available from Aurelius 2.8 and up and handles memo fields better.