Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Check Before Insert

$
0
0

Hi ALL ,

I have 2 tables . I need to write an insert script that should contain the logic of checking if the records are present in the destination table and then perform the insert accordingly .

so 2 tables

Source

Destination

ID  Type Name
1 Dev Rdread
2 Prod Fdread
3 SIT Qdread
4 PROD Tdread

ID Type  Name Date
1 Dev Rdread getdate()
2 Prod Fdread getdate()

Like in this case Source contains 4 records and Destination 2 so before inserting i wish that it should check for both type and Name if those records are not present then insert so ideally in this case insert for

Should be performed . Please provide the insert script so as per        that i can modify my actual case.

Thanks

SIT Qdread
PROD Tdread


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>