COPY STRUCTURE Command

Example   See Also

Creates a new, empty free table with the same structure as the currently selected table.

Syntax

COPY STRUCTURE TO TableName
  [FIELDS FieldList] [[WITH] CDX | [WITH] PRODUCTION]
  [DATABASE cDatabaseName [NAME cTableName]]

Arguments

TableName

Specifies the name of the new, empty table to create.

In Visual FoxPro, null value support and the code page for the new, free table are identical to the currently selected table.

FIELDS FieldList

Specifies that only the fields whose names are specified in the FieldList are copied to the new table. If you omit FIELDS FieldList, all fields are copied to the new table.

[WITH] CDX | [WITH] PRODUCTION

Creates a structural index file for the new table that is identical to the structural index file of the existing table. The tags and index expressions from the original structural index file are copied to the new structural index file.

The CDX and PRODUCTION clauses are identical.

In Visual FoxPro, a primary index for the currently selected table is converted to a candidate index for the new empty table.

DATABASE cDatabaseName

Specifies the name of an existing database to which the new table is added. Note that the table and field properties are not copied to the database.

NAME cTableName

Specifies the name of the table as it appears in the database.