![]() Constraint remains Successful and constraints are = 0 and > 0 You'll set it to Expression and Constraint. The trick here is to modify the Precedent Constraint between the parent task (Data Flow) and the child paths. After the data flow runs, you'll have a value of zero (good to load) or greater than zero - send email.īifurcate the Data Flow task into Data Flow Task which actually stores to our table and Notification (Send Email Task, Execute SQL Task to send email, whatever). I'd go easy and use a Row Count transformation which will fill an SSIS variable you create called RowsNull. The first Data Flow will be Flat File Source to Conditional Split and then. The approach without a stage table would be to double process your file. ![]() INSERT INTO dbo.Final SELECT * FROM dbo.StageData AS SD WHERE NOT EXISTS (SELECT * FROM dbo.StageData AS SDI SDI.HasNull ='Y') It might need to be ANY or just repeat the send mail logic and have the insert as the ELSE clause. Double check my logic here as I haven't coded this up. I'd then have an Execute SQL Task that snaps the data from stage into the final table. The first sends email (assuming you have _send_dbmail set up) I'd do something IF EXISTS (SELECT * FROM dbo.StageData AS SD WHERE SD.HasNull = 'Y')ĮXECUTE _send_db_mail = 'ocean800', = 'Null detected' You'd then add two Execute SQL Tasks after the data flow. ![]() ![]() ![]() ALTER TABLE dbo.stageDataĪDD HasNull AS (CASE WHEN Col1 IS NULL OR Col2 IS NULL THEN 'Y' ELSE 'N') The cleanest/easiest to implement is just stuff all your data into a staging table and since I'm lazy, I'd add a computed column to the table definition that flags a row as having a null somewhere. Nothing out of the box directly supports this scenario but I can think of a few approaches you can cobble together to achieve your request. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |