SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,681 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi,
I am getting this error Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done which I cannot figure out. My execute SQL Task has the following code which I can run in SSMS fine:
DECLARE @errorMsg VARCHAR(max) ;
DECLARE @cntAdr INT = ?;
DECLARE @cntFooterAdr INT = 0;
DECLARE @cntAdrLang INT = ?;
DECLARE @cntFooterAdrLang INT = 0;
DECLARE @cntPatc INT = ?;
DECLARE @cntFooterPatc INT = 0;
SELECT @cntFooterAdr = cntRows
FROM ref.ref_ndb_FileRows n
WHERE n.[fileName] LIKE 'Adr[_]%'
AND CAST(LoadDate AS DATE) = CAST(CURRENT_TIMESTAMP AS DATE);
IF @cntAdr != @cntFooterAdr
BEGIN
SET @errorMsg = CONCAT('Address Row Count ', @cntAdr, ' does not match footer row count ', @cntFooterAdr, '.');
END;
SELECT @cntFooterAdrLang = cntRows
FROM ref.ref_ndb_FileRows n
WHERE n.[fileName] LIKE 'AdrLang[_]%'
AND CAST(LoadDate AS DATE) = CAST(CURRENT_TIMESTAMP AS DATE);
IF @cntAdrLang != @cntFooterAdrLang
BEGIN
SET @errorMsg = ISNULL(@errorMsg + CHAR(13),'') + CONCAT('AdrLang Row Count ', @cntAdrLang, ' does not match footer row count ', @cntFooterAdrLang, '.');
END;
SELECT @cntFooterPatc = cntRows
FROM ref.ref_ndb_FileRows n
WHERE n.[fileName] LIKE 'Patc[_]%'
AND CAST(LoadDate AS DATE) = CAST(CURRENT_TIMESTAMP AS DATE);
IF @cntPatc != @cntFooterPatc
BEGIN
SET @errorMsg = ISNULL(@errorMsg + CHAR(13),'') + CONCAT('Contacts Row Count ', @cntPatc, ' does not match footer row count ', @cntFooterPatc, '.');
END;
SELECT @errorMsg as errorMsg;
The parameters are configured as follows:
I cannot figure out where the error is.
Thanks in advance
Figured this out. Apparently we need to have DECLARE statement for each parameter.