共用方式為


SQL Server Upsizing Wizard: Step 4 – Map Field Data Types

In this step, Visual FoxPro displays the default data type mappings used to convert local data to remote data, as tables are upsized to the server. You can choose to change these default mappings.

You can't change the default mapping for a key field to a data type that prevents the field from being indexed. You can change the default mapping of a field that is part of an index key if you choose a data type that is indexable; however, you might want to change the data types for the other fields in the key to match. Visual FoxPro warns you if you change the default data type mapping for a field that is not a key field but is used in a Visual FoxPro index. If you make a mistake, click Default to reset the data types.

  • Table
    Select the table whose fields you want to map from the list of all the tables you've chosen to upsize.
  • Timestamp column
    Select this check box to add a timestamp column to the server version of the table. If you want to apply this to all tables, you can save time by checking the All Tables checkbox.
  • Identity column
    Select this check box to add an identity column to the server version of the table. If you want to apply this to all tables, you can save time by checking the All Tables checkbox.
  • Default
    Choose this button to reset all table field settings for all fields in the selected table back to their defaults. This button in effect undoes any changes you have entered for a specific table in Step 4.
  • Field Name
    Lists the fields contained in the table you selected in the Table list.
  • FoxPro Type
    Lists the Visual FoxPro data type for the field.
  • Server Type
    Lists the server data type to which Visual FoxPro data in this field will be mapped when the table is copied to the server. Click in this field to display a drop-down list from which you can select a different server data type.
  • Width
    Specifies the width of the field.
  • Precision
    Specifies the decimal precision of the field, when applicable.

Creating Timestamp Columns

A SQL Server timestamp column contains a unique value, generated by SQL Server that is updated whenever the server record is updated. Using a timestamp field on an updateable remote table can increase performance and reliability.

If you update fields using the Visual FoxPro SQL WhereType values DB_KEYANDMODIFIED or DB_KEYANDUPDATABLE, Visual FoxPro must check all modified or all updateable fields to determine whether they were changed by another user. Because text or image fields can be many megabytes in size, comparing these fields for changes can be network-intensive and time-consuming, thereby reducing performance. Reliability can also be affected, because converting the value of a floating-point field between client and server might cause the value to appear to have changed when it has not.

When you add a timestamp field to a remote table and update using the SQL WhereType value DB_KEYANDTIMESTAMP, Visual FoxPro uses only the value in the timestamp field to determine whether a record has been changed before updating it. Because Visual FoxPro can compare the value in the timestamp field more quickly than it can evaluate the contexts of large text or image fields, you can increase performance on remote data. However, if you use the SQL WhereType value DB_KEYANDTIMESTAMP, any change in the remote record is recognized as an update conflict, whether or not the changed remote field is in the list of fields you've set as modifiable in your remote view.

If you prefer to update fields using the Visual FoxPro SQL WhereType values DB_KEYANDMODIFIED, you might improve performance by setting the remote view's Compare Memo property to false (.F.). When CompareMemo is set to false, Memo fields are removed from the list of remote view fields compared against the data in the remote server row.

See Also

SQL Server Upsizing Wizard | SQL Server Upsizing Wizard: Step 1 - Select Local Database | SQL Server Upsizing Wizard: Step 2 - Select Data Source | SQL Server Upsizing Wizard: Step 3 - Choose Tables | SQL Server Upsizing Wizard: Step 5 - Select Target Database | SQL Server Upsizing Wizard: Step 6 - Set Database Properties | SQL Server Upsizing Wizard: Step 7 - Specify Log Properties | SQL Server Upsizing Wizard: Step 8 - Set Upsizing Options | SQL Server Upsizing Wizard: Step 9 - Finish | Wizards Overview