Hi all, 

Actually i am working in banking domain. Our company has decided to change the data provider, so all the old data should be migrated to new one i.e., old provider code and unique business key should be replaced with new provider code and business key

so here the twist is : if a client has 3 different plan(means 3 different unique business key with old provider code ) , these 3 different plan will be converted to 1 unique business key and new provider code as below 

TableA

unique business keyprovider codeAmount
1110000
1215000
12312000

to

TableA

unique business keyprovider codeAmount
529764217000

529764- is new unique business key and 2 - is new provider code and total amount -17000

so the above information is maintained in a 1 main transaction TableA and another child table is there which holds fund amount TableB

1 TableA
2. TableB

TableB

unique business keyprovider codefundIDAllocation_PercentageAllocated_amount
11150.005000
11250.005000
121150.002500
121350.002500
1231150.001000
1231450.001000

After migration It is very easy to just delete the TableA and insert with new single row, but now the problem is with TableB

So after migration TableB should look like below

TableB

unique business keyprovider codefundIDAllocation_PercentageAllocated_amount
5297642150.008500
5297642229.45000
5297642314.72500
529764245.91000

Please help me to do the above thing. I have to do it in Mysql but i want to know how to do it in mssql so that i will convert it to My sql , can you all help me to do this through some nice sql program procedure logic .. it would be great. if i get the correct logic