Hi team ,
I have a view that consist of different tables from various databases like .
create view vw_mifin_mapping
select customer from db1.dbo.tbl_mifin_mapping
select customer from db2.dbo.tbl_mifin_mapping
select customer from db3.dbo.tbl_mifin_mapping
select customer from db4.dbo.tbl_mifin_mapping
when i fetched this view i got some duplicate entries and after checking the records in tables i find that db1.dbo.tbl_mifin_mapping and db3.dbo.tbl_mifin_mapping both contains customer pr0091
There is a standard mapping table tbl_check_mapping exists that contains customer,dbname where customer pr0091 is mapped in db3.dbo.tbl_mifin_mapping.
My question is there might be some more records in future how can i find and delete the duplicate entries from physical tables automaticaly using sql code.