SSIS does not work with an error message, as shown below:
Code: 0xC0202009 Source: DFT Populate ImageSummary OLE_SRC ProductImage [1] Description: SSIS error code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error Code: 0x80004005. An OLE DB record is available. Source: "Microsoft SQL Internal Client" Hresult: 0x00040EDA Description: "Warning: Null is excluded by aggregation or other SET operation."
In the study, we found that the Warning: Null value is eliminated by an aggregate or other SET operation. message Warning: Null value is eliminated by an aggregate or other SET operation. returned by a SQL query (2005), which runs the SSIS package as a source in the DFT to insert into the target table.
Select ProductID ,ImageTypeID ,DistinctImageCount ,ImageSize from (select a.ProductID ,a.ImageTypeID ,a.DistinctImageCount ,a.ImageSize ,RANK() OVER (PARTITION BY a.ProductID, a.ImageTypeID ORDER BY a.ImageSize) As Ranker from (SELECT TOP 100 Percent spi.ProductID ,sit.ImageTypeID ,CAST(COUNT(DISTINCT spi2.ImageTypeID) as bit) DistinctImageCount ,CAST(spi2.Size as varchar(50)) as ImageSize FROM Stage.ProductImage spi CROSS JOIN Reference.ImageType sit LEFT JOIN Stage.ProductImage spi2 ON spi.ProductID = spi2.ProductID AND sit.ImageTypeID = spi2.ImageTypeID GROUP BY spi.ProductID, sit.ImageTypeID,spi2.Size ORDER BY spi.ProductID, sit.ImageTypeID,spi2.Size )a )b where ranker = 1 Order by ProductID,ImageTypeID
We solved the problem by excluding the warning from the SQL server by changing the query:
FROM
CAST(COUNT(DISTINCT spi2.ImageTypeID)as bit) DistinctImageCount
For
CAST(SUM(DISTINCT ISNULL(spi2.ImageTypeID,0)) as bit) DistinctImageCount .
However, we have few questions, as below, which we could not find an explanation and hoping to get an answer in this forum:
Why does a warning from SQL pop up before the SSIS package and causes the SSIS package to not work?
If we run the same package in all other dev and UAT environments with the same dataset, it works fine. We can see the warning shown in SQL Server Management Studio, however, SSIS will fail. However, the SSIS package does not work in our products. We do not understand the logic? Is there any warning threshold here?
Parik sarkar
source share