Hey.
I have table A. This table does not have any PK, it just stores lots of rows, which can only be identified by combination of its column values.
There is procedure that takes data from table A, and from other tables, does proper matching/processing and feeds table B.
Now, how do I check if data from table A is correctly inserted into table B?
It is sql server 2000 so EXCEPT is not a solution.
Maybe some procedure that would include:
- cursor would fetch rows from table A ,
- do select on B (with proper column matching)
- and then if matching row has been found (select returned some data) increase counter (number of properly propagated rows)
- if no matching row was found put data we were looking for into temporary table (for later review)
Update: Procedure that feeds table B doesn't put all rows from table A into table C. Additionally It also takes data from other table (let's call it C) and puts it into B (but also not all rows). I thought that maybe using one cursor to check B for data from A and then other cursor to check B for data from C would be good solution.