MsSql 2008 nvarchar(max) problem
Posted: 28.02.2023, 23:36
MsSql 2008 nvarchar(max) problem
I am asking for help with the following problem:
Zeos version: 7.2.14-release
Lazarus version: 2.2.4 FPC: 3.2.2
Operating system: win10
ZConnection properties:
AutoEncodeStrings=ON
codepage=CP_UTF8
controls_cp=CP_UTF16
ZConnection protocol: ado
After connecting, I can see nvarchar(800), but I can't see the nvarchar(max) data.:
names(nvarchar(max),nul)
ZQuery1.FieldByName('names').AsString;
ZQuery1.FieldByName('names').AsWideString;
ZQuery1.FieldByName('names').AsUTF8String;
ZQuery1.FieldByName('names').AsUnicodeString
I try any of them, my variable is empty!
It is interesting that:
i:=length(ZQuery1.FieldByName('names').AsUnicodeString);
'i' always returns a good value.
I can modify it: 'UPDATE tbl_data set names = '''+ 'New name: ÁáÖöÜüÓóÉéŐőÚú'+',' +''' where id = '''+tbl_id+'''';
This works fine, I can see the modified data correctly in SQL Server Management Studio.
I am asking for help with the following problem:
Zeos version: 7.2.14-release
Lazarus version: 2.2.4 FPC: 3.2.2
Operating system: win10
ZConnection properties:
AutoEncodeStrings=ON
codepage=CP_UTF8
controls_cp=CP_UTF16
ZConnection protocol: ado
After connecting, I can see nvarchar(800), but I can't see the nvarchar(max) data.:
names(nvarchar(max),nul)
ZQuery1.FieldByName('names').AsString;
ZQuery1.FieldByName('names').AsWideString;
ZQuery1.FieldByName('names').AsUTF8String;
ZQuery1.FieldByName('names').AsUnicodeString
I try any of them, my variable is empty!
It is interesting that:
i:=length(ZQuery1.FieldByName('names').AsUnicodeString);
'i' always returns a good value.
I can modify it: 'UPDATE tbl_data set names = '''+ 'New name: ÁáÖöÜüÓóÉéŐőÚú'+',' +''' where id = '''+tbl_id+'''';
This works fine, I can see the modified data correctly in SQL Server Management Studio.