Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2014

    Unanswered: please help to form the procedure

    I want to copy multiple rows, joining 2 tables and insert into one of the table. As the final outcome I want the id to be altered in between the process of insertion.
    For example:
    Fund Table
    ID FundID Fund_Name
    1 10 OLDFUND1
    2 11 OLDFUND2
    3 31 NEWFUND1
    4 32 NEWFUND2

    Price table
    ID Prices FundID
    1 120 10
    2 15 11

    I want to copy the existing data of the PRICETABLE where Grp_FundId1 is 1,
    and paste into the same table but the Grp_FundID should be mapped with the NEWFUNDS inserted in FUNDTABLE.So the final priceTable should look like

    Price table
    ID Prices FundID
    1 120 10
    2 15 11
    3 120 31
    4 15 32

    I have written a procedure in which I have used a temp table to copy the data first and alter in loop and then again inserting back to the price table from temp.The idea is correct but it seems going no where.Please suggest a solution.

  2. #2
    Join Date
    Feb 2004
    In front of the computer
    Provided Answers: 54
    Please post your procedure. That will help us understand what you're trying to accomplish.


    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts