[转]Mapping Stored Procedure Parameters in SSIS OLE DB Source Editor
I was working on a SSIS Data Flow Task by passing Package Variables into a Stored Procedure. I will be using [AdventureWorks] sample database included with the SQL Server installation. Below is the screenshot of bits and pieces of my SSIS Package configuration.
As you can see, I have defined 2 Package Variables and using the [AdventureWorks] database connection and a Flat File Connection Manager to dump out the [uspGetWhereUsedProductID] Stored Procedure's output.

This is the SQL command text I am using in the OLE DB Source Editor dialog window.
EXEC [dbo].[uspGetWhereUsedProductID] ?, ?
Here is the screenshot of the Parameter Mapping.

As you can see, Parameter0 and Parameter1 were used to match the Stored Procedure's parameters' ordinal positions. When I execute the Data Flow Task, I get the following error message.
The SQL command requires a parameter named "@ParameterName", which is not found in the parameter mapping.component "OLE DB Source" (1) failed the pre-execute phase and returned error code 0xC0207014.
It was obvious that I am not mapping the Stored Procedure's parameters with the SSIS Package Variables correctly. I looked up OLE DB Source in the MSDN Library Documentation. The Specifying Parameters by Using Names section used AdventureWorks database's [uspGetWhereUsedProductID] stored procedure as an example and passing in @StartProductID and @CheckDate parameters.
The following SQL statement runs the uspGetWhereUsedProductID stored procedure, available in the AdventureWorks database.
EXEC uspGetWhereUsedProductID ?, ?
The stored procedure expects the variables,@StartProductIDand@CheckDate, to provide parameter values. The order in which the parameters appear in the Mappings list is irrelevant. The only requirement is that the parameter names match the variable names in the stored procedure, including the @ sign.
That is *exactly* what I am doing and I am getting the error. So I am pretty sure the MSDN Documentation is not clear enough (or maybe even incorrect).
Additionally, I looked up How to: Map Query Parameters to Variables in a Data Flow Component listed under the Configuring the OLE DB Source section. Again, it doesn't give any more information. By this point, I was getting pretty frustrated.
I browsed the MSDN Forums and discovered that many other developers are having the SAME problem. I carefully re-read the OLE DB Source documentation in case I missed something and finally noticed this line.
The only requirement is that the parameter names match the variable names in the stored procedure, including the @ sign.
I added/replaced the following with the actual Stored Procedure's Parameter names.
- The Question Marks (?) in the SQL command text
Parameter0andParameter1in the Set Query Parameters dialog window

I was very happy to discover that my SSIS Package runs successfully after the changes.
I really wished the MSDN Documentation team gave more details on OLE DB Source Parameter Mapping. It would have saved me the headache of looking for a solution and feeling like pulling out my hair.
Happy Programming, Soe
[转]Mapping Stored Procedure Parameters in SSIS OLE DB Source Editor的更多相关文章
- [转]SSIS OLE DB Source中执行带参数的存储过程
本文转自:http://www.cnblogs.com/michaelxu/archive/2009/10/21/1587450.html 问题描述:执行一个存储过程得到一个多条记录的结果集,然后循环 ...
- [转]SSIS中OLE DB Source中如何执行Store Procedure 以得到源数据
本文转自:http://www.cnblogs.com/michaelxu/archive/2009/10/16/1584284.html 有很多人喜欢在OLE DB Source中执行Store P ...
- 微软BI 之SSIS 系列 - 通过 OLE DB 连接访问 Excel 2013 以及对不同 Sheet 页的数据处理
文章更新历史 2014年9月7日 - 加入了部分更新内容,在文章最后提到了关于不同 Office Excel 版本间的连接问题. 开篇介绍 这篇文章主要总结在 SSIS 中访问和处理 Excel 数据 ...
- [转]ssis cannot retrieve the column code page info from the ole db provider
本文转自:http://social.msdn.microsoft.com/Forums/sqlserver/en-US/dc1a61f2-1ab8-4ed3-b85c-db6481800b50/er ...
- [转]SSIS: Execute Package via Stored Procedure
本文转自:http://sqlblog.de/blog/2009/09/ssis-execute-package-via-stored-procedure/ There are two options ...
- EF 接收OUTPUT参数的方法 How to Retrieve Stored Procedure Output Parameters in Entity Framework
原文地址:http://blogs.microsoft.co.il/gilf/2010/05/09/how-to-retrieve-stored-procedure-output-parameters ...
- Entity Framework 6.0 Tutorials(9):Stored Procedure Mapping
Code First - Insert, Update, Delete Stored Procedure Mapping: Entity Framework 6 Code-First provides ...
- [转]Dynamic SQL & Stored Procedure Usage in T-SQL
转自:http://www.sqlusa.com/bestpractices/training/scripts/dynamicsql/ Dynamic SQL & Stored Procedu ...
- Retrieving Out Params From a Stored Procedure With Python
http://www.rodneyoliver.com/blog/2013/08/08/retrieving-out-params-from-a-stored-procedure-with-pytho ...
随机推荐
- How ConcurrentHashMap offers higher concurrency without compromising thread safety
https://www.ibm.com/developerworks/library/j-jtp08223/
- MapReduce案例二:好友推荐
1.需求 推荐好友的好友 图1: 2.解决思路 3.代码 3.1MyFoF类代码 说明: 该类定义了所加载的配置,以及执行的map,reduce程序所需要加载运行的类 package com.hado ...
- phoenix到hbase的应用
一.phoenix的简介 hbase的java api或者其语法很难用,可以认为phoenix是一个中间件,提供了访问hbase的另外的语法. 二.配置phoenix和hbase 1.下载 phoen ...
- google code-prettify 代码高亮插件使用方法
找代码高亮插件选了好久,还是这个使用起来比较方便. 先上链接:插件下载地址 官方使用方法地址 建议看官方的资料,我这里仅仅简要描述一下使用方法: 引入方法: 测试引入是否成功:herf 换成 自己放置 ...
- 微信小程序 - 分包加载
小程序开发大家都知道,对主包的大小进行了限制,从最初的1M变成了现再的2M,一般情况下是够用了:但是偶尔可能会出现超出2M的可能,我们可以对小程序进行分包加载. 1.小程序分包加载 a. 某些情况下, ...
- 用matplotlib绘制漫画风格的图表
自从有了计算机,便很少有人手工绘制图表了.计算机绘制出的图表横平竖直,可以随意使用各种颜色,也完全不用担心画错需要重来的问题. 但有没有一种感觉,看多了工整的图表,变得有些审美疲劳.在各行各业逐渐过渡 ...
- react native 增加react-native-storage
现时需要使用react-native-storage本地存储 第一步:配置storage主文件 mystorage.js import { AsyncStorage } from 'react-nat ...
- vue-music 关于Player (播放器组件)--播放模式
播放器播放模式有三种,顺序播放,单曲循环,随机播放,定义在vuex 中的字段为 mode.点击切换播放模式的图标.切换模式判断是否为随机播放,如果是随机播放模式,则取得sequenceList 列表数 ...
- centos定时备份数据库超简单示例
#mkdir -p /home/db_backup#cd /home/db_backup #vim mysql_backup.shDATE=$(date +%Y%m%d_%H%M%S) /alidat ...
- 按照grouip分组,之后分组调用生成正式凭证 的接口
按照grouip分组,之后分组调用生成正式凭证 的接口 Map<String, List<OperatingLogVO>> resultMap = new HashMap< ...