Ok. I've scoured the universe searching for an answer. I've tried just about everything but can't get this to work right. I apologize for the up & coming descriptive email but it will be necessary to show you my work.
I'm running both "Execute SQL Task" in OLE DB. Task #1 goes to Server-A (for example) and Task #2 goes to Server-B (for example).
I have a select statement that will ALWAYS return 1 record. 5 values. This works fine in Task #1. I've set my variables on the left to a SSIS Package scope.
Task #1:
Connection: Server-A (for example)
ResultSet: Single Row (tried all options in here by the way)
ConnectionType: OLE DB
SQLSourceType: Direct Input
BypassPrepare: True
ResultSet:
Task #1 completes successfully.
On Success go to Task #2:
Connection: Server-B (for example)
ResultSet: None
ConnectionType: OLE DB
SQLSourceType: Direct Input
SQLStatement: (this is a stored procedure) Exec AddScheduledInfo ?, ?, ?, ?,?
Parameter Mapping:
(NOTE: I started with 0, 1, 2, 3, 4 on the "Paramter Name" but even if I run a simple "Select ?, ?, ?, ?, ?" I got errors with the numbers. When I changed it to the current values of @variablename, the "Select...." statement worked.)
Now here's the kicker. If I hard-code values into my stored proc, it runs great. No errors. Green across the board!! But when I replace the hard-coded values with the ? I get the following error:
"[Execute SQL Task] Error: Executing the query "Exec AddScheduledInfo ?, ?, ?, ?, ?" failed with the following error: "The statement has been terminated.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly."
Connection is good because it works fine with hard-coded values, so I eliminate that "problem".
"ResultSet property..." issue, I don't buy. I don't want a result set. But for troubleshooting purposes I tried them all. I get a different type of error (still) when I try any of them.
This leads me to the "parameters not set correctly" problem.
I'm at a loss of what to do at this point. I've been off 'n on this issue for 2 days now & feel I'm just forgetting 1 simple thing. I don't know what that 1 thing is though. So finally reaching out for some ideas.
Thanks ahead of time & hope to get this resolved.