Stored Procedure to Compare 2 table and create new records if new RRS feed

  • Question

  • Hi team,

    I am new to SQL, I have the concept below I want this to implement in my project, Please assist me how can I achieve this,

    I have Primary Table A and secondary table B

    Need to Check below,

    select each ID from table A begin with counter = 1 .....till counter reach end ID
    compare ID from table A with table B

    If Exists
    Update into table B

    If not exits 
    insert into table B (ID)

    For each new ID created in table B fill stage_number column start from 1 ends till 100

    example screen shot attached from excel


    • Moved by CoolDadTx Tuesday, November 3, 2020 3:05 PM Not C# related
    Tuesday, November 3, 2020 1:21 PM

All replies