使用SSIS将数据从一个数据库复制到另一个数据库

编程入门 行业动态 更新时间:2024-10-23 17:37:00
本文介绍了使用SSIS将数据从一个数据库复制到另一个数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在编写一个SSIS包,并尝试将数据从一个数据库提取到另一个数据库。我创建了一个Execute SQL任务,并使用以下语句INSERT INTO dbo.getParties EXEC dbo.getParties来执行该操作。当源和目标在同一数据库中时,此方法有效。当源和目标位于不同的数据库中时,该如何处理。您只能将一个连接管理器关联到一个任务。

我是否连接到源并在SP中调用目标?这是正确的方法吗?

下面是我的模板的设计

解决方案

使用

..并且在数据流任务中使用目标和源助手,您可以为每个助手定义其自己的连接字符串。

当然,除了这些,您还可以应用所需的任何类型的数据转换。

编辑:由于您的源是SQL Command(存储过程),因此需要在源助手。如您所见,只需将数据访问模式更改为 SQL命令并设置为 EXEC getParties :

I am writing a SSIS package and trying to extract the data from one database to another. I have created a Execute SQL task and using the following statement INSERT INTO dbo.getParties EXEC dbo.getParties to perform the operation. This works when the source and destination our in the same database. How do I handle this when the source and destination are in different databases. You can associate only one connection manager to a task.

Do I connect to the source and in the SP call the destination. Is it the right way of doing it

Below is the design of my template

解决方案

Use Data Flow component where you can set up the source and destination connection strings.

..and inside the data flow task use the Destination and Source Assistants that let you define its own connection string for each.

Of course, besides these you can also apply any sort of data transformations you wish.

Edit: Since you your source is SQL Command (stored procedure) you need to define it in your source assistant. As you can see here, just change Data Access Mode to SQL Command and set to EXEC getParties:

更多推荐

使用SSIS将数据从一个数据库复制到另一个数据库

本文发布于:2023-10-16 16:43:03,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1498147.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:数据库   数据   SSIS

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!