Our application updates and accesses data using SQL Server 2014.
I have a table of which the last column ('Contents') is created as VARCHAR(MAX)
.
We are using Delphi XE8, and are using a FireDAC TFDQuery
component to update this column.
.....
FDquery.ParamByName('Contents').AsString:=Contents;
FDquery.ExecSQL;
When running this update, I get the following error:
Exception raised with message [FireDAC][Phys][ODBC]-345. Data too large for variable [CONTENTS]. Max len = [8002], actual len = [13829] Hint: set the TFDParam.Size to a greater value.
'Contents' can be string of varying length.
Browsing the web, the only reasonably simple solution that I found is changing the query as follows:
FDquery.ParamByName('Contents').AsWideMemo:=Contents;
FDquery.ExecSQL;
Is this acceptable, or should I be handling this differently?
There is nothing fancy with 'Contents', as I mentioned, it is simply a long string.