Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
theboyholty
Posting Yak Master
226 Posts |
Posted - 2011-03-08 : 10:08:54
|
I am very new to SSIS and I'm using SSIS 2008.I have a stored proc in SQL which does all sorts of things like builds tables, imports text files, indexes, updates etc so there's no actual 'output' as such. It is a precursor to more SPs which will populate more tables from external files and build a useable dataset programatically.My SP is usp_KV_01 ( @FileNameCustomer VARCHAR (255) ,@FileNameProspects VARCHAR(255))I've created a package and added an Execute SQL Task into the control flow, edited it and set up some of the following properties:ResultSet: Full result setConnectionType: OLE DBSQLSourceType: Direct InputSQL Statement: EXEC usp_KV_01 ? ?In the parameter mapping tab I've created an item:Variable Name: User::FileNameCustomerDirection: InputData Type: VARCHARParameter Name: FileNameCustomerParameter Size: 1In the ResultSet tab:Resultname: 0Variable name: User::FileNameCustomerYet when I try to run it I get the message: "[Execute SQL Task] Error: Executing the query "EXEC usp_KafeVend_Proc01 ? ?" failed with the following error: "Parameter name is unrecognized.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly."I've run out of ideas. Can anyone tell me what I need to do to be able to run a Stored Proc which requests parameters before executing?---------------------------------------------------------------------------------http://www.mannyroadend.co.uk The official unofficial website of Bury Football Club |
|
YellowBug
Aged Yak Warrior
616 Posts |
Posted - 2011-03-09 : 04:44:23
|
Your stored procedure is expecting two inputs. Try this:Change the ResultSet to none.Your Parameter Names should be a number starting from zero, so:In the parameter mapping tab:Variable Name: User::FileNameCustomerDirection: InputData Type: VARCHARParameter Name: 0next:Variable Name: User::FileNameProspectsDirection: InputData Type: VARCHARParameter Name: 1You say "My SP is usp_KV_01" but appear to be calling a procedure called usp_KafeVend_Proc01. Check the SP names.Hope this helpsThis is a good example: http://www.sqlis.com/sqlis/post/The-Execute-SQL-Task.aspx |
|
|
|
|
|