SQL_Variant data type

Does anybody have any experience (performance, ODBC, …) using SQL Data Type = Variant for Attain Code fields?. Thanks in advance, Jesús Soage

I have experience with it. What do you want to know?

Robert, I also have this kind of problems with access database. I try to import from an Access database a text value and put it in a Navision Table, but I get an error if the value is empty in Access; “This data type is not supported by C-side. You can access data from any of the following data types VT_VOID, VT_I2, VT_I4 …” Could you tell me what I have to do to make it work. Thanks [8)]

A long time ago a had a similar problem. I tried open a “foreign” SQL table in Navison. Everything was OK except, that the empty field caused an error. My conclusion was, that there is difference between “empty” field and field which “contains” empty string in SQL databese. But I am not sure :frowning:

Ickx, You are referring to the variant type used for automation. I cant help there. The original question was the SQL Data Type = Variant field property for a Code field.

Hi Robert, I like to know if there is any performance problem (specially when you use these fields in keys with SumIndexFields). On the other hand, what about ODBC, I tested it with Excel XP with no problems, but I want to know if you found any problems using these SQL fields with other programs. Finally, I understand that with these fields I get in Navision the same sort as Code fields, that is, if the field have only numbers it is treated as a number and sorted by value. Is that true? Thanks in advance for your reply, Jesús Soage

Value is null. Navision can’t have null values in SQL tables. Change SQL field properties not null Best regards from BCN.

We used “Actualsize” to resolve the empty field problem and it works . Thanks [:p]

Jesus, The performance is the same as for non-variants. In terms of integration with other products, it depends on how clever the other products have been with the manipulation of the variant type, since it needs slightly different handling in terms of binding. I haven’t tried very many, I think only Microcost tools and products, which work fine. It is true that you get the same style of ordering as the Navision Server Code field; the pure integers are ordered as integers and are separated from the alphanumerics. The only difference is that the integer group orders before the character group, whereas in navision server they order after. But this is a somewhat arbitrary decision and I dont think it matters.