|
@@ -725,11 +725,16 @@ begin
|
|
ftString, ftFixedChar:
|
|
ftString, ftFixedChar:
|
|
begin
|
|
begin
|
|
FieldSize := col.MaxLength;
|
|
FieldSize := col.MaxLength;
|
|
- if FieldSize > dsMaxStringSize then FieldSize := dsMaxStringSize;
|
|
|
|
|
|
+ if FieldSize >= $3FFFFFFF then // varchar(max)
|
|
|
|
+ FieldType := ftMemo;
|
|
|
|
+
|
|
end;
|
|
end;
|
|
- ftMemo, ftBlob,
|
|
|
|
ftBytes, ftVarBytes:
|
|
ftBytes, ftVarBytes:
|
|
|
|
+ begin
|
|
FieldSize := col.MaxLength;
|
|
FieldSize := col.MaxLength;
|
|
|
|
+ if FieldSize >= $3FFFFFFF then // varbinary(max)
|
|
|
|
+ FieldType := ftBlob;
|
|
|
|
+ end;
|
|
ftBCD:
|
|
ftBCD:
|
|
begin
|
|
begin
|
|
FieldSize := col.Scale;
|
|
FieldSize := col.Scale;
|
|
@@ -738,10 +743,10 @@ begin
|
|
end;
|
|
end;
|
|
ftGuid:
|
|
ftGuid:
|
|
FieldSize := 38;
|
|
FieldSize := 38;
|
|
- else
|
|
|
|
- FieldSize := 0;
|
|
|
|
- if col.Identity and (FieldType = ftInteger) then
|
|
|
|
- FieldType := ftAutoInc;
|
|
|
|
|
|
+ else
|
|
|
|
+ FieldSize := 0;
|
|
|
|
+ if col.Identity and (FieldType = ftInteger) then
|
|
|
|
+ FieldType := ftAutoInc;
|
|
end;
|
|
end;
|
|
|
|
|
|
with FieldDefs.Add(FieldDefs.MakeNameUnique(FieldName), FieldType, FieldSize, (col.Null=0) and (not col.Identity), i) do
|
|
with FieldDefs.Add(FieldDefs.MakeNameUnique(FieldName), FieldType, FieldSize, (col.Null=0) and (not col.Identity), i) do
|