I have an old database (OldDB) with a table (let's call it Call) that I'm using SSIS (2008) and a new database (NewDB) with the following setup:
OldDB.Callhas a column calledStatuswhich currently is varchar(1) and holds values such as "C", "D", etc.NewDBnow maps all the possible statuses in its own table with a foreign key constraint so thatOldDB.Call.Statusis nowNewDB.CallStatus.idAn example of the data in theNewDB.Call.StatusIDwould be1,2,3and so forth.NewDB.CallStatusnow has a column calledStatuswhich holds the actual nvarchar(1) value ofA,B,C, etc.
I'm using SSIS to migrate the data. So far, I know I need to use a Sort transformation for each source and then a Merge Join transformation to map the new NewDB.Call.StatusID to the OldDB.Call.Status value. For whatever reason, it seems to start just fine but ends up grabbing other columns (like a description column, for example) and shoves the wrong kind of data in there. In short, it's not mapping the foreign key like it should.
I've found numerous examples on the web on how to do this (like this) but it seems like I'm missing some key, critical piece of information in order to understand what I'm doing because I keep borking it.
In a perfect world, a step-by-step would be great but a good and concise tutorial or explanation would be useful as well. In short, I need to know how to hook those two tables up and map the value in OldDB to the foreign key in the the NewDB and store that value in NewDB.CallStatus.