SSIS Error: [Execute SQL Task] Error: Executing the query "exec ?=Authors_insert ?" failed with the following error: "Value does not fall within the expected range.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctl
Friday, August 10, 2012 3:37 PM
When i try to execute the below query in SQL Execute Task:
exec ?=Authors_insert ? , from here i call the stored procedure named Authors_insert as given below:
alter procedure Authors_Insert
insert into Authors (FirstName) values (@FirstName)
Please find below the screenshots of my SQL Execute Task:
I am getting the below mentioned error message:
SSIS Error: [Execute SQL Task] Error: Executing the query "exec ?=Authors_insert ?" failed with the following error: "Value does not fall within the expected range.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly.
Friday, August 10, 2012 3:47 PMModerator
The string needs to be surrounded with ' s in T-SQL looks like why this insert is failing
Furthermore, you probably do not expect anything returned, so exec ? = ... is a moot point
Arthur My Blog
- Edited by ArthurZMVP, Moderator Friday, August 10, 2012 3:47 PM
Saturday, August 11, 2012 12:04 PMno screenshot attached??
Please mark the post as answered if it answers your question
Sunday, August 12, 2012 4:37 PM
In the Execute SQL task use the below query.
EXEC Authors_Insert ?
In the parameter mapping map SSIS variable you have created for FirstName with parametername as 0
- Marked As Answer by Ramasubramanian. S (Partner) Monday, August 13, 2012 2:45 PM
Monday, August 13, 2012 2:45 PM
Thanks for your post, i could resolve this issue when i changed the Query as
EXEC Authors_Insert ?, but what is the main difference between this one and EXEC ?=Authors_Insert ?.
Tuesday, August 14, 2012 5:19 AM
Syntax wise EXEC ?=Authors_Insert ? is wrong.
If you execute the same in sql server management studio it will throw error (replace ? with parameter).
We use ? to pass parameter in execute sql task.So ? after EXEC does not make any sense and also =.
Hope this has answered your question.
Tuesday, August 14, 2012 6:24 AMThanks yogish for your clarification.
- Edited by Ramasubramanian. S (Partner) Tuesday, August 14, 2012 6:24 AM