Cannot pass value to variable to stored procedure in ssis
When executing an SSIS package, the following message appears:
[OLE DB Source [83]] Error: The SQL command requires a parameter named "@Sales_person" that was not found in the parameter mapping.
[SSIS.Pipeline] Error: The OLE DB source did not pass the pre-execution phase and returned error code 0xC0207014.
Below is a screenshot of my original OLE DB editor
I see the Param direction tab in the Set Query parameters, how is this used? In my case, I will use Input
either Output
orInputOutput
source to share
After searching, I didn't find a solution for this problem that worked for me. There are many suggestions like adding SET NOCOUNT ON
before the execute command. Below are some links:
- http://geekswithblogs.net/stun/archive/2009/03/05/mapping-stored-procedure-parameters-in-ssis-ole-db-source-editor.aspx
- http://www.sqlservercentral.com/articles/Data+Flow+Task+(SSIS)/117370/
- http://www.ssistalk.com/2007/10/10/ssis-stored-procedures-and-the-ole-db-source/
You can do a workaround
Declare SSIS variable (assuming @[User::Query]
)
Set @[User::Query]
property EvaluateAsExpression
= True and use the following expression
"EXEC [dbo].[GetDales_Person_data] " + @[User::Sales]
if @[User::Sales]
is a string use the following
"EXEC [dbo].[GetDales_Person_data] '" + @[User::Sales] + "'"
Then OLEDB Source
use In SQL Command from variable
and select@[User::Query]
source to share