Page 1 of 1

Why is TWideMemoField?

Posted: Thu 02 Jan 2014 07:52
by Eden0928
My Code:

Code: Select all

SELECT 'ABC ' || 'DEF' AS TEST
I get the "TEST" is TWideMemoField.
But, when get TWideStringField in MS SQL Server.

Re: Why is TWideMemoField?

Posted: Thu 02 Jan 2014 08:20
by AlexP
Hello,

Such behaviour is due to that server doesn't send such field size, and if a string field ha no size, we map it to a Memo field. To solve the problem, you should enable the UnknownAsString option.

Code: Select all

SQLConnection.Params.Values['UnknownAsString '] := 'True';

Re: Why is TWideMemoField?

Posted: Thu 02 Jan 2014 09:34
by Eden0928
Have other adverse effects it?
AlexP wrote:

Code: Select all

SQLConnection.Params.Values['UnknownAsString '] := 'True';

Re: Why is TWideMemoField?

Posted: Thu 02 Jan 2014 10:48
by AlexP
Hello,

If this setting is enabled, all the fields, that we cannot determine data type for, will be mapped as TStringField.