Table Element

Each <Table> element represents one Btrieve table to migrate. A table element with an empty Name (Name="") serves as a global default whose settings are inherited by all other tables.

<Table Name="Person" Filename="person.dat" Schema="dbo"
       OwnerName="" PageSize="4096" RecordSize="128"
       PrimaryIndex="0" VariableLength="n" TrueNullable="n"
       RequireBtrieveFile="y" PreserveRecordPosition="n"
       IgnoreNullValues="y" OemTranslation="n"
       OverwriteExistingTable="y" EraseTableBeforeCopy="n"
       MakeIndexesUnique="y" SqlLobMode="n">
  ...
</Table>

Table Definition Attributes

These attributes describe the structure of the Btrieve table. In the DDF variant (Btrieve2SqlMigration), most of these come from the DDFs and are not needed. In the Full Migration variant, they are required or strongly recommended.

Attribute

Required

Default

Description

Name

Yes

(none)

Name of the table. For the DDF variant, this must match the table name as defined in the Pervasive/Btrieve DDFs. For the Full variant, this becomes the SQL table name and should be a valid SQL identifier. An empty string (Name="") marks this entry as the global default.

Filename

Full only

(none)

Relative or absolute path to the Btrieve data file. This determines the .INT filename and is used during data copy. In the Full variant, this attribute is required.

Schema

Yes

(none)

The SQL schema in which to create the table (e.g., dbo).

OwnerName

No

(empty)

The Btrieve file owner name (password). Required if the Btrieve file is password-protected so it can be opened for reading during data copy. Not used during application runtime.

PageSize

No

(from file)

Page size of the Btrieve file. Not used by SQL; informational only. Full variant only.

RecordSize

No

(calculated)

Size in bytes of the fixed portion of the record. If omitted, the value is computed by summing the field sizes. Full variant only.

PrimaryIndex

No

(auto)

Which index number (0-based) to treat as the primary key. If omitted, an index on an auto-increment field is used, or MDSRECNUM if no auto-increment field exists. Full variant only.

VariableLength

No

n

Whether the Btrieve record is variable length (can store data beyond the fixed-length portion). Full variant only.

TrueNullable

No

n

Whether the table supports Btrieve “true nulls” (as opposed to legacy null handling). Full variant only.

Migration Option Attributes

These attributes control how the migration is performed for this table. They are available in both the DDF and Full variants.

Attribute

Required

Default

Description

RequireBtrieveFile

No

y

If y, the migration fails when the Btrieve data file cannot be found. If n, the migration proceeds without the file, but some metadata (e.g., B_STAT information) may be incomplete. Set to n when you only need to generate INT files or SQL scripts without the original data.

MarkIntAsPermanent

No

n

If y, the generated INT file is marked as permanent (read-only). A permanent INT cannot be overwritten by subsequent Create or BuildIndex operations.

PreserveRecordPosition

No

n

If y, the exact Btrieve auto-increment values are preserved when copying data to SQL. If n, the SQL server assigns new unique values.

IgnoreNullValues

No

y

If y, values considered “null” in Btrieve are excluded from Get fetch sequences. This matches standard Btrieve behavior. Setting to n reduces SQL overhead but may change application behavior.

RememberServerName

No

n

If y, the SQL server name is written into the INT file and will override settings from the registry, INI file, or login dialog at runtime.

RememberDatabaseName

No

n

If y, the database name is written into the INT file and will override settings from the registry, INI file, or login dialog at runtime.

RememberSchema

No

n

If y, the schema name is written into the INT file and will override settings from the registry, INI file, or login dialog at runtime.

EraseTableBeforeCopy

No

n

If y, the SQL table is truncated before copying new records. Only applies when performing a data-copy-only operation.

OverwriteExistingTable

No

n

If y, an existing SQL table is dropped and recreated. If n and the table already exists, the migration returns an error.

OemTranslation

No

n

If y, OEM-encoded character data in the Btrieve file is translated to ANSI before writing to SQL. The data is converted back to OEM codepage when read by the application at runtime.

SqlLobMode

No

n

If y, the variable portion of Btrieve records is split into individual SQL LOB (Large Object) columns based on offset/length values in the fixed record portion, rather than storing the entire variable portion as a single blob.

AllowFieldsBeyondRecLen

No

n

If y, fields defined beyond the fixed record length cause the record size to expand to accommodate them. Useful for certain applications (e.g., Peachtree) where DDF definitions extend past the declared record length.

MakeFixedLen

No

n

If y, forces the record to be treated as fixed-length. Implies AllowFieldsBeyondRecLen="y" and overrides VariableLength. The fixed record size is expanded to accommodate all defined fields.

MakeIndexesUnique

No

y

If y, primary key segments are appended to non-unique Btrieve indexes to make them unique in SQL. This is required for correct Btrieve record positioning behavior and should almost always be left at the default.

DisableReplValues

No

(from INI)

If y, disables the automatic replacement/substitution of empty and null values. The driver will return errors instead of substituting default values. Overrides the global INI setting for this table.

SqlCollation

No

(driver default)

Default SQL collation for string fields in this table. Individual fields can override this with their own SqlCollation attribute. Common values for MSSQL:

  • Latin1_General_BIN2 — Binary sort order (matches Btrieve)

  • SQL_Latin1_General_CP1_CI_AS — Case-insensitive ANSI

MSSQL-Specific Attributes

Attribute

Required

Default

Description

FilegroupTable

No

(default)

MSSQL filegroup for table data storage.

FilegroupIndex

No

(default)

MSSQL filegroup for index storage.

FilegroupText

No

(default)

MSSQL filegroup for large fields (text, ntext, image, xml, varchar(max), nvarchar(max), varbinary(max)).

Child Elements

A <Table> element may contain the following child elements. The order matters when using DTD validation: