I have staging table and need a dimension table. I also need to add a surrogate key. I am using SSIS. How do I go about it?

时间:2017-04-10 01:31:49

标签: sql-server ssis

My staging table is [sabyastaging].[dbo].[CustomerSTG] has the following fields : [customer#],[cust-name],[address],[telephone#]

I need a dimension table (Customer) which as the fields : [customer#],[address] and [telephone#].

Also I need a surrogate key. I am using management studio and SSIS. How do I do it?

Help shall be appreciated!

1 个答案:

答案 0 :(得分:1)

首先创建目标维度表:

Maybe Text

使用自动递增列创建SK,该列也可以作为表的主键。仓库中的维度和事实表不应具有任何外键引用,尤其是返回到临时区域。另外,我会避免像#34;#"在你的表格或列名中,我会尝试将所有你的名字拼写成人类可读的形式 - 毕竟,这些表格可能面向最终用户,需要易于理解。

启动Visual Studio并创建SSIS项目。为源表和目标表创建连接。拖动"数据流"任务到画布上,然后双击它。拖动OLE DB源连接器,并提供源数据库和登台表的连接信息。对目标维度表执行相同的操作。

单击数据流连接器并将其从源拖动到目标 - 您将从源连接到目标连接有一条绿线。双击目标连接,您将看到一种可以将输入列映射到输出列的方法 - 只需单击并从源拖动到目标。

点击F5,它应该运行。

相关问题