编辑类型映射 (DB2ToSQL) Edit Type Mapping (DB2ToSQL)

利用 " 编辑类型映射 " 对话框,您可以指定如何在源数据库对象和目标数据库对象之间映射类型。The Edit Type Mapping dialog box lets you specify how types are mapped between the source and destination database objects.

可以在以下几个位置访问此对话框:You can access this dialog box in several places:

  • 选择源数据库或数据库对象时," 类型映射 " 选项卡将显示在 "元数据资源管理器" 右侧。When you select a source database or database object, the Type Mapping tab appears to the right of the metadata explorer. 单击 " 添加 " 以添加新的类型映射,或者单击 " 编辑 " 更改现有的类型映射。Click Add to add a new type mapping, or click Edit to change an existing type mapping.

  • 在 " 工具 " 菜单上,选择 " 项目设置 " 或 " 默认项目设置"。On the Tools menu, select Project Settings or Default Project Settings. 在生成的对话框中,选择 " 类型映射"。In the resulting dialog box, select Type Mapping. 单击 " 添加 " 以添加新的类型映射,或者单击 " 编辑 " 更改现有的类型映射。Click Add to add a new type mapping, or click Edit to change an existing type mapping.

表特定的类型映射会重写数据库和项目类型映射。Table-specific type mappings override database and project type mappings. 数据库特定的映射会替代项目映射。Database-specific mappings override project mappings.

选项Options

源类型Source type
选择要映射到数据类型的源数据类型 SQL ServerSQL ServerSelect the source data type to map to a SQL ServerSQL Server data type.

如果数据类型的长度可变,以下字段将显示在 " 源类型" 下:If the data type is of variable length, the following fields will appear under Source type:

FromFrom
指定此映射的最小长度。Specify the minimum length for this mapping. 例如,对于 nchar 数据类型,可以输入10来指定此映射适用于从 nchar (10) 开始的范围。For example, for the nchar data type, you can enter 10 to specify that this mapping is for a range starting at nchar(10).

ToTo
指定此映射的最大长度。Specify the maximum length for this mapping. 例如,对于 nchar 数据类型,可以输入20来指定此映射适用于以 nchar (20) 结束的范围。For example, for the nchar data type, you can enter 20 to specify that this mapping is for a range ending at nchar(20).

目标类型Target type
选择 SQL ServerSQL Server 源数据类型要映射到的数据类型。Select the SQL ServerSQL Server data type to which the source data type is mapped. 当 SSMA 在中创建表或存储过程时 SQL ServerSQL Server ,源数据类型将更改为此数据类型。When SSMA creates the table or stored procedure in SQL ServerSQL Server, the source data type will change to this data type.

如果数据类型的长度可变,以下字段将显示在 " 目标类型" 下:If the data type is of variable length, the following field will appear under Target type:

Replace withReplace with
指定此映射的目标长度。Specify the target length for this mapping. 例如,对于 nvarchar 数据类型,可以输入20来指定应将指定的源数据类型映射到 nvarchar (20)For example, for the nvarchar data type, you can enter 20 to specify that the specified source data type should be mapped to nvarchar(20).