在 BIDS 中使用存储过程作为 OLE DB 源 [英] Using Stored Procedure As OLE DB Source In BIDS

查看:35
本文介绍了在 BIDS 中使用存储过程作为 OLE DB 源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在测试 SSIS 包和存储过程,因为我只是一个初学者.我需要做的是使用我在源数据库上安装的存储过程来返回数据集,然后我需要一个 ssis 包来使用存储过程返回的数据集作为 OLE DB 源来填充第二个目标表.

I am testing SSIS packages and stored procedures as I am only a beginner. What I need to do is use a stored procedure i have installed on a source database to return a dataset and then I need an ssis package to use the dataset returned by the stored procedure as an OLE DB source to populate a second, destination table.

基本上我有2张桌子:- 测试源- 测试目的地

Basically I have 2 tables: - test_source - test_destination

test_source 有一个名为 Companies 的表,有 3 行 -(ID、名称、已建立).我已经设置了一个存储过程 (spGetCompanies) 来将该表中的所有记录返回到一个结果集中.

test_source has one table titled Companies with 3 rows - (ID, Name, Established). I have set up a stored procedure(spGetCompanies) to return all records in that table into a result set.

然后在 BIDS 中,我有一个 SSIS 包,它从 test_source 表(在本例中为 spGetCompanies SP)获取数据并将其插入到 test_destination 表中.

Then in BIDS I have an SSIS package which takes data from the test_source table (In this case, the spGetCompanies SP) and inserts it into the test_destination table.

谁能告诉我如何使用 spGetCompanies 存储过程作为 OLE DB 源来提供帮助?

Can anyone help by telling me how I can use the spGetCompanies Stored procedure as the OLE DB source?

西安

推荐答案

假设您已经设置了数据连接,请执行以下操作:

Assuminng you've set up your data conenction, do the following:

  1. 双击您的 OLEB 源
  2. 选择您的连接管理器项目
  3. 选择数据访问模式为SQL 命令"
  4. 输入您的 SQL 命令以执行您的 SP(例如 exec usp_myproc 1234).
  5. 点击预览".应该返回您的数据集.
  6. 点击确定"

完成

这篇关于在 BIDS 中使用存储过程作为 OLE DB 源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆