9
Answers

Before insert how to check the records if it exists or not

vijay reddy

vijay reddy

8y
315
1
hi,
 
I created two tables like
create Table A (pid bigint, pname varchar, psource varchar(10))
create Table #temp (id bigint, name varchar, source varchar(10))
table A having lakhs of rows and table #temp having lakhs of  rows
i want to check the records based on #temp table and insert into Table A.
how to check the records before insert values from #temp table to table A
insert into A
(pid,
pname,
psource
)
select
id,
name,
source
from #temp
Please give me the solution for the above query.
 

Answers (9)