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

  • Thread starter Thread starter sarathkousi
  • Start date Start date
S

sarathkousi

Guest
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 excel1624014.png

Thanks..

Continue reading...
 
Back
Top