概述:导入表中数据 (Master Data Services)Overview: Importing Data from Tables (Master Data Services)

适用于:Applies to: 是SQL ServerSQL Server(所有支持的版本)yesSQL ServerSQL Server (all supported versions) - 仅限 Windows 是Azure SQL 托管实例Azure SQL Managed InstanceYesAzure SQL 托管实例Azure SQL Managed Instance适用于:Applies to: 是SQL ServerSQL Server(所有支持的版本)yesSQL ServerSQL Server (all supported versions) - Windows only 是Azure SQL 托管实例Azure SQL Managed InstanceYesAzure SQL 托管实例Azure SQL Managed Instance

Master Data ServicesMaster Data Services中创建数据模型后,你便可以开始添加数据,并能更改数据。Once you've created a model for your data in Master Data ServicesMaster Data Services, you can start adding data and make changes to data. 你使用 Master Data ServicesMaster Data Services 临时表、存储过程和主数据管理器。You use Master Data ServicesMaster Data Services staging tables, stored procedures and Master Data Manager .

有关如何添加和修改数据的说明,请参阅导入表中的数据 (Master Data Services)For instructions on how to add and modify data, see Import Data from Tables (Master Data Services).

备注

你还可以使用 SQL ServerSQL ServerMaster Data ServicesMaster Data Services用于 Excel 的外接程序Add-in for Excel,将 Excel 中的数据添加到 MDS 存储库(Master Data ServicesMaster Data Services 数据库)中。You can also use the SQL ServerSQL ServerMaster Data ServicesMaster Data Services用于 Excel 的外接程序Add-in for Excel, to add data to the MDS repository ( Master Data ServicesMaster Data Services database) from Excel. 有关详细信息,请参阅概述:从 Excel 导入数据(用于 Excel 的 MDS 外接程序)For more information, see Overview: Importing Data from Excel (MDS Add-in for Excel).

在添加和修改数据时,你可以执行以下操作。When you add and modify data, you can do the following.

  • 加载和更新成员,并更新属性值Load and update members, and update attribute values

  • 停用和删除成员Deactivate and delete members

  • 移动显式层次结构成员Move explicit hierarchy members

添加和更新数据包括以下主要任务。Adding and updating data includes the following main tasks.

  1. 将数据加载到 Master Data ServicesMaster Data Services 数据库中的临时表中。Load data into the staging tables in the Master Data ServicesMaster Data Services database.

  2. 将数据从临时表加载到相应的 Master Data ServicesMaster Data Services 表中。Load the data from the staging tables into the appropriate Master Data ServicesMaster Data Services tables.

    你使用临时存储过程或 主数据管理器Master Data Manager 来加载数据。You use staging stored procedures or 主数据管理器Master Data Manager to load the data.

备注

SQL Server 2016 (13.x)SQL Server 2016 (13.x)中,已停止提供对 SQL Server 2008 R2SQL Server 2008 R2 临时过程的支持。In SQL Server 2016 (13.x)SQL Server 2016 (13.x), support for the SQL Server 2008 R2SQL Server 2008 R2 staging processes is deprecated.

停用和删除成员 (MDS)Deactivating and Deleting Members (MDS)

停用意味着可以重新激活成员。Deactivating means the member can be reactivated. 如果您重新激活某成员,可还原成员的属性以及成员在层次结构和集合中的成员身份。If you reactivate a member, its attributes and its membership in hierarchies and collections are restored. 以前的所有事务都将保持不变。All previous transactions are intact. 管理员可以在主数据管理器的“版本管理” 功能区域中查看停用事务。Deactivation transactions are visible to administrators in the Version Management functional area of the Master Data Manager.

删除意味着从系统中永久清除成员。Deleting means purging the member from the system permanently. 将永久删除该成员的所有事务、所有关系和所有属性。All transactions for the member, all relationships, and all attributes are permanently deleted.

备注

不能使用临时过程来重新激活成员。You cannot use staging to reactivate members. 你必须在主数据管理器中手动执行此操作。You must do it manually in the Master Data Manager. 有关详细信息,请参阅重新激活成员或集合 (Master Data Services)For more information, see Reactivate a Member or Collection (Master Data Services).

不能使用临时过程来删除或停用集合。You cannot use staging to delete or deactivate collections. 有关手动停用集合的详细信息,请参阅删除成员或集合 (Master Data Services)For more information on manually deactivating collections, see Delete a Member or Collection (Master Data Services).

移动显式层次结构成员 (MDS)Moving explicit hierarchy members (MDS)

当你批量移动成员在显式层次结构中的位置时,你可以指定以下内容。When you move the location of members in explicit hierarchies in bulk, you can designate the following.

  • 作为合并成员的父级的合并成员。A consolidated member as a parent of a consolidated member.

  • 作为叶成员的父级的合并成员。A consolidated member as a parent of a leaf member.

  • 作为叶成员或合并成员的同级的叶成员。A leaf member as a sibling of a leaf or consolidated member.

  • 作为叶成员或合并成员的同级的合并成员。A consolidated member as a sibling of a leaf or consolidated member.

临时表和存储过程 (MDS)Staging Tables and Stored Procedures (MDS)

Master Data ServicesMaster Data Services 数据库包含以下类型的临时表,你可以使用你的数据填充它们。The Master Data ServicesMaster Data Services database includes the following types of staging tables that you can populate with your data.

模型中的每个实体都有一个临时表。For each entity in the model, there is a staging table. 表名称指示相应的实体以及实体类型,如叶成员。The table name indicates the corresponding entity, and the entity type such as leaf member. 下图显示货币、客户和产品实体的临时表。The following image shows the staging tables for the currency, customer, and product entities.

MDS 数据库中的临时表Staging Tables in MDS database

该表的名称在创建实体时指定,且不可更改。The name of the table is specified when an entity is created and cannot be changed. 如果临时表的名称包含 _1 或其他数字,则在创建实体时已存在带此名称的其他表。If the staging table name contains a _1 or other number, another table of that name already existed when the entity was created.

Master Data ServicesMaster Data Services 包括以下类型的临时存储过程。The Master Data ServicesMaster Data Services includes the following types of staging stored procedures.

  • stg.udp_ <name> Leafstg.udp<name>_Leaf

  • stg.udp_ <name> Consolidatedstg.udp<name>_Consolidated

  • stg.udp_ <name> Relationshipstg.udp<name>_Relationship

对于模型中的每个实体,有三个对应于叶成员、合并成员和关系临时表的存储过程。For each entity in the model, there are three stored procedures that correspond to the leaf member, consolidated member, and relationship staging tables. 下图显示货币、客户和产品实体的临时存储过程。The following image shows the staging stored procedures for the currency, customer, and product entities.

MDS 数据库中的临时存储过程Staging stored procedures in the MDS database

有关存储过程的详细信息,请参阅临时存储过程 (Master Data Services)For more information on the stored procedures, see Staging Stored Procedure (Master Data Services).

记录事务 (MDS)Logging Transactions (MDS)

导入或更新数据或关系时,可以记录发生的所有事务。All transactions that occur when data or relationships are imported or updated can be logged. 存储过程中的选项允许进行此日志记录。An option in the stored procedure allows this logging. 如果使用 主数据管理器Master Data Manager启动临时过程,则不进行日志记录。If you initiate the staging process using 主数据管理器Master Data Manager, no logging occurs.

Master Data Services 配置管理器Master Data Services Configuration Manager中, “记录临时事务” 设置不应用于暂存数据的此方法。In Master Data Services 配置管理器Master Data Services Configuration Manager, the Log staging transactions setting does not apply to this method of staging data.