Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Haarish
Starting Member
30 Posts |
Posted - 2009-07-06 : 00:56:08
|
Hi All,I have an SSIS package that has a data flow from a flat file source to a SQL server table. I have a lookup with which I will compare one column of the source file to a dimension table in the database and if they are not equal, send them to the 'Unmatched Rows' error output. If there are unmatched rows, then I will have to fail the rest of the package. I have created 2 'Row count' tasks one before and one after the Lookup. I have assigned the output to 2 global variables(package level). In a script task I compare the values of the global variables and if they are not the same then I fail the package. But the global variables do not reflect the correct values i.e. their value is always 0. Is there something that I am missing?Thanks,Haarish. |
|
Narendranath
Starting Member
2 Posts |
Posted - 2009-07-07 : 05:54:33
|
Haarish,Can you let me know how are you calling(executing) the SSIS package. Are you calling from the Source code or executing it manually .Thanks,Naren |
 |
|
Haarish
Starting Member
30 Posts |
Posted - 2009-07-07 : 06:26:50
|
Hi Naren,I manually execute the SSIS package. I have managed to get the work done. Apparently SSIS global variables being updated inside a dataflow reflect the change only after the data flow task completes execution. So even though thr row count tasks set values to my variables the change in value is not being reflected.What I did was added a 'Aggregate' task instead of the 'Row count' and selected 'Count all' as the option in the task. This option returns a DT_UI8 which SQL Server does not have a equivalent. so I converted the output to a DT_I8 using a 'Data Conversion' task and fed that to a SQL Server destination. At a later stage in the same dataflow, I validated the values in the SQL table in a Script task and when the numbers do not match the script raises an error and the package will fail.Can you think of doing this in a easier way?Thanks,Haarish. |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-07-08 : 13:22:50
|
if your intention was just to check if there was any lookup failure (unmatched rows), then fail package, isnt it enough to just set on error property of lookup task to fail package? |
 |
|
|
|
|