Page 1 of 1

Using TUniQuery with SQL Server type nvarchar(max)

Posted: Thu 27 Mar 2014 16:36
by dturchetti
Hi all,
I'm using UniDac 4.0.1 with Delphi XE2 and SQL Server 2008.
I'm having problems when doing an insert into a table with a field of type NVARCHAR(max)

Code: Select all

    ...
    qry.ParamByName('LONGDATA').AsString := ALongString; //6000 chars
    qry.ExecSQL;
Insert is successfull, but the field is corrupted at position 4000 with a '\0' and some other chars.
Using SQL Trace, I can see the generated query has a parameter of type NVARCHAR(max) but its value is already corrupted, so the problem lies in Delphi application.
Any ideas? Any help is really appreciated, thanks.

Daniele Turk

Re: Using TUniQuery with SQL Server type nvarchar(max)

Posted: Mon 31 Mar 2014 13:39
by dturchetti
I did some tests: problem is fixed with version 5.2.7 for Delphi XE2 and writing the parameter AsMemo:

Code: Select all

qry.ParamByName('LONGDATA').AsMemo:= ALongString; //6000 chars
qry.ExecSQL;
Thanks anyway

Re: Using TUniQuery with SQL Server type nvarchar(max)

Posted: Tue 01 Apr 2014 07:58
by Dimon
It is good to see that the problem has been solved. Feel free to contact us if you have any further questions.