Possible Duplicate:
Select / Insert version of an Upsert: is there a design pattern for high concurrency?
I have to insert data from one table to another on the basis of condition.
1.If Key is found update records
2.If key is not found insert the record.
I am using sql server 2005. So can not use merge
statement. Please suggest the alternative to achieve this