Executing Stored Procedure: Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.
Tuesday, February 12, 2013 8:17 PM
I have the following stored procedure
CREATE PROCEDURE [dbo].[GetEmailAddress]
DECLARE @combinedString varchar(255)
DECLARE @ToAddress varchar(255)
SELECT @combinedString = COALESCE(@combinedString + ';','') + ToAddress ,@Toaddress =(select distinct FromAddress from dbo.acn_GetEmailDetails)
where MailMessage='Missing File' and Flag=1 and SourceName=@SrcName
I am using a SQL Task for executing this procedure,
EXECUTE [dbo].[GetEmailAddress] ?
I am getting the below error message,Not sure what is wrong,i checked the parameter mapping and result set ,everything look okay..
[Execute SQL Task] Error: Executing the query "
" failed with the following error: "Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
Appreciate any help..
Tuesday, February 12, 2013 8:27 PM
Try commenting out the second SELECT, the one that just says SELECT @combinedString, @ToAddress
Sebastian Sajaroff Senior DBA Pharmacies Jean Coutu
Tuesday, February 12, 2013 8:28 PM
Since you declared @SrcName as a parameter, make sure you pass an argument for that parameter when you execute the stored procedure:
EXEC [dbo].[GetEmailAddress] @SrcName= 'Varchar Value';
Also, if you want to return something from the stored procedure, you'd want to add a RETURN to your SELECT statement at the end:
RETURN (SELECT @combinedString,@ToAddress)