ExecuteSQL task fails and I think it should not

I setup my ExecuteSQL task to have a "Single Row" resultset. The query returns no rows. It fails. I don't think it should but then maybe this is consistent with the lookup transform piping rows down the error output if there is not a lookup value returned.

The error returned is

Error: 0xC002F309 at Execute SQL Task, Execute SQL Task: An error occurred while assigning a value to variable "Variable": "Single Row result set is specified, but no rows were returned.".
Thanks

Allan

[491 byte] By [AllanMitchell] at [2008-3-5]
# 1
Doesn't sound right to me. If you were getting the MAX of something its perfectly plausible that no results would be returned (if no records in the table).

-Jamie

JamieThomson at 2007-9-8 > top of Msdn Tech,SQL Server,SQL Server Integration Services...
# 2
Exactly Big Smile
AllanMitchell at 2007-9-8 > top of Msdn Tech,SQL Server,SQL Server Integration Services...
# 3
Hmm... interesting. Can you open this on BetaPlace, please?

thanks!
ash

AshSharma at 2007-9-8 > top of Msdn Tech,SQL Server,SQL Server Integration Services...
# 4
I'm working with the realease version and having the same problem. Any answer to this?
NF at 2007-9-8 > top of Msdn Tech,SQL Server,SQL Server Integration Services...
# 5

The following discussion pertains to the Execute SQL Task Control flow.

THE SUGGESTIONS I MAKE ARE TO THE PROPERTIES WHICH YOU HAVE TO RIGHT CLICK AND GO TO PROPERTIES ON THE EXECUTE SQL TASK. DO NOT TRY TO CORRECT THIS PROBLEM IN THE EXECUTE SQL TASK EDITOR.

What you need to do is change the "ForceExecutionResults" property to "Success." This will fix your problem.

Secondly you need to be watchful of your MaximumErrorCount property else your system will fail out.

I hope this helps merry christmas.

JoeQuint at 2007-9-8 > top of Msdn Tech,SQL Server,SQL Server Integration Services...
# 6

SELECT 0 + ISNULL((SELECT MAX( COLUMN1 ) FROM TABLE1 WHERE COLUMN2 = 'XXX'), 0)

OR

SELECT '' + ISNULL((SELECT COLUMN1 FROM TABLE1 WHERE COLUMN2 = 'XXX'), '')

doing so, you will always have a result the task can forward.

Not pretty but preferable vs. the ForceExecutionResults solution i think.

montechristo at 2007-9-8 > top of Msdn Tech,SQL Server,SQL Server Integration Services...
# 7

It took me a while to find this thread that describes my problem. It appears that this has never been addressed as I am running SP1 and am still having the problem. I would have thought this was a fairly basic bug and would have been fixed by now. Any feedback about a permanent solution from the SSIS development team?

I also prefer the coded ISNULL workaround over setting the ForceExecutionResults property. You can also use the COALESCE function to the same effect, which I prefer for similar scenarios.

highpockets at 2007-9-8 > top of Msdn Tech,SQL Server,SQL Server Integration Services...
# 8
highpockets wrote:
It took me a while to find this thread that describes my problem. It appears that this has never been addressed as I am running SP1 and am still having the problem. I would have thought this was a fairly basic bug and would have been fixed by now.
bug reports should be submitted here: http://connect.microsoft.com/feedback/default.aspx?SiteID=68
DuaneDouglas at 2007-9-8 > top of Msdn Tech,SQL Server,SQL Server Integration Services...

SQL Server

Site Classified