Hi Ahmed. I think the question is not so much one of how you might accomplish such a task but rather one of why you would want to do such a thing and whether it’s a good idea.
It sounds like you’re trying to consolidate data from multiple companies/databases into a single data set. If that’s the case, you should know that it can not be done by simply copying all of the new data into a single database. You will have primary key violations that you won’t be able to resolve without either modifying the data in the PK fields so that it becomes unique, or modifying the definition of the PK for each table so that the existing data makes the entry unique.
Just think about the G/L Entry table for just a second. If all of your branch databases have any transactions that created entries in the G/L Entry table, then all of those databases will have an entry in the table with a primary key value for the first record where Entry No. = 1. Since the data in the Primary Key must be unique within the Company, you’ll get a runtime error if you try to insert all of these branch entries into the main branch table.
If I’ve misunderstood what you’re trying to do with your data, could you maybe give us a bit more detail?