stored procedure which checks the value in another table

  • I have two tables called A and B and C. Where A and C has the same schema

    A contains the following columns and values

    -------------------------------------------

    PoId Podate Approved

    22008-07-07 No

    42007-05-05 No

    52005-08-06 Yes

    62006-07-07 Yes

    Table B contains the following columns and values

    -------------------------------------------------

    TaskId TableName Fromdate Approved_Status

    1 A 7/7/2007 No

    3 B 2/4/2006 Yes

    Now i need to create a stored procedure that should accept the values (Yes/No) from the Approved_Status column in Table B and should look for the same values in the Approved column in Table A. If both values match then the corresponding rows in Table A should be archived in table C which has the same schema as that of Table A. That is the matching columns should get deleted from Table A and shoud be inserted into Table C.

    Pls provide me with full stored procedure code.

    It is very urgent.

  • I'm afraid that requests to "please give me full stored procedure code" aren't going to get you very far on this board. At least show us what you've tried. Generally requests like this happen when the homework assignment is due next hour, or someone has internet access during an interview and they have no clue what they're doing...

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply