Bir tabloda olmayan satırları diğer tabloya insert (the rows which are not exists insert to another table)
Bu procedure iki tabloyu karşılaştırarak olmayan satırları diğer tabloya insert eder.
create procedure olmayaniYaz
as
begin
insert into OKUTULAN_DERSLER_2(DERS_ID,DERS_ADI)
select DERS_ID,DERS_ADI FROM OKUTULAN_DERSLER where DERS_ID NOT IN (select DERS_ID from OKUTULAN_DERSLER_2)
end
exec olmayaniYaz
create procedure olmayaniYaz
as
begin
insert into OKUTULAN_DERSLER_2(DERS_ID,DERS_ADI)
select DERS_ID,DERS_ADI FROM OKUTULAN_DERSLER where DERS_ID NOT IN (select DERS_ID from OKUTULAN_DERSLER_2)
end
exec olmayaniYaz
Yorumlar
Yorum Gönder