0

Hopefully I can explain this correctly. enter image description here

I am currently using MSSQL 2008 and I have two databases with 2 tables. In DB1, Table 1 has a username and a UserID. Table 2 has a GUID and a UserID. The UserID in table 2 is added to show which user added the row. I have migrated tables 1 and 2 from DB1 to DB2 but the UserID from Table 1 in DB2 is different from DB1. I want to keep the UserID and match up the users from DB1 into DB2 correctly to match up with table 2 in DB2. The UserID in Table 2 in DB2 should change. Is there an easy way of doing this?

1 Answer 1

1

Late answer, but hopefully it will help others.

We had a huge project where we merged 20 databases each containing hundreds of tables into one database.

The end solution was very easy and a part of the solution was:

On every table we added two new fields - originalID and originalDB. In this case you don't need to keep track of the originalDB.

Then you port all the data from Table1 across, but paste the UserID into OriginalID. Then paste the data from Table2 in, but join to table1 on table2.userid = table1.userid to return the new userid.

If you paste the DataID into OriginalID you then have your trail back to the original.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.