[转]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 ...
随机推荐
- WPS2019体验
不久之前WPS2019发布了, 说实话, 做的真的不错. 没找到2016版本多得吓人的广告, 没有那糟糕的页面设计, 没有那卡顿的体验. 而且不同的程序(文字, 演示)做成了类似标签页的形式, 体验比 ...
- (转) Spring源码阅读 之 Spring整体架构
标签(空格分隔): Spring 声明:本文系转载,原地地址:spring framework 4 源码阅读 Spring骨架 Spring的骨架,也是Spring的核心包.主要包含三个内容 cont ...
- 《逐梦旅程 WINDOWS游戏编程之从零开始》笔记4——Direct3D编程基础
第11章 Direct3D编程基础 2D游戏是贴图的艺术,3D游戏是渲染的艺术.这句话在我学过了之前的GDI编程之后,前一句算是有所体会,现在是来理解后一句的时候了. 安装DirectX SDK配置啥 ...
- hdu 2881(LIS变形)
Jack's struggle Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Others) ...
- centos7 mariaDB安装
参考:http://www.linuxidc.com/Linux/2016-03/128880.htm
- bootstrap 在django中的使用
一.应用 http://www.bootcss.com/进入bootstrap4或bootstrap3中文网,想要快速地将 Bootstrap 应用到你的项目中,有以下两种办法: 1.boot ...
- python链接mysql以及mysql中对表修改的常用语法
MySQL是一个关系型数据库管理系统 ,其体积小.速度快.总体拥有成本低,尤其是开放源码这一特点,一般中小型网站的开发都选择 MySQL 作为网站数据库.在使用过程中不总是和它打交道,导致使用时候都得 ...
- 洛谷P1801 黑匣子
题目传送门 分析:这题和另外一个题目中位数非常相似,有兴趣可以先看看,比这一题简单.首先暴力模拟还是别想了,估计30%的数据都有点悬.正解应该是用二叉堆.但是如果用一个堆当然不方便,所以建两个堆,一个 ...
- 大数据技术之_11_HBase学习_02_HBase API 操作 + HBase 与 Hive 集成 + HBase 优化
第6章 HBase API 操作6.1 环境准备6.2 HBase API6.2.1 判断表是否存在6.2.2 抽取获取 Configuration.Connection.Admin 对象的方法以及关 ...
- Bzoj3566/洛谷P4284 [SHOI2014]概率充电器(概率dp)
题面 Bzoj 洛谷 题解 首先考虑从儿子来的贡献: $$ f[u]=\prod_{v \in son[u]}f[v]+(1-f[v])\times(1-dis[i]) $$ 根据容斥原理,就是儿子直 ...