RRinTetons
IS-IT--Management
I have two table variables, one called @ChangedID contains a selection of primary keys, and the other called @EmployeeMap that tells me how to get from one database to another to find the records in the second database that need to be changed.
For each row in @ChangedID I need to find matching rows in @EmployeeMap. @ChangedID is on the order of 10 rows, @EmployeeID is on the order of 100 rows.
If there are matching rows then I need to do some complex processing in the second db. Lots of conditional branching to determine what's required and how to accomplish it. I can do it nicely with a loop that works through the rows of @ChangedID, and given the number of rows involved it wouldn't be heinous, but I'd like to try to do it better. Does that info suggest any better approaches?
-
Richard Ray
DBA, Developer, Data Analyst
Jackson Hole Mountain Resort
For each row in @ChangedID I need to find matching rows in @EmployeeMap. @ChangedID is on the order of 10 rows, @EmployeeID is on the order of 100 rows.
If there are matching rows then I need to do some complex processing in the second db. Lots of conditional branching to determine what's required and how to accomplish it. I can do it nicely with a loop that works through the rows of @ChangedID, and given the number of rows involved it wouldn't be heinous, but I'd like to try to do it better. Does that info suggest any better approaches?
-
Richard Ray
DBA, Developer, Data Analyst
Jackson Hole Mountain Resort