Using Merge into statement, you can either insert or update a row.

Merge into Syntax

 Merge into upsert_table as Temp
using (values
(1, 2, 3),
(4, 5, 6),
(7, 8, 9)
---- more rows
) As Merge (C1, C2, C3)
On Temp.Key_to_Match = Merge.Key_to_Match
When Matched Then
Update set temp.c1 = merge.c1,
temp.c2 = merge.c2,
temp.c3 = merge.c3
When Not Matched Then
Insert (c1, c2, c3)
Values(Merge.c1, Merge.c2, Merge.c3)

Example :

Merge into EmpTable As Temp
Using (Values
(120, 'STEVE', 'SMITH')
) As Merge (EmpId,FirstName,LastName)
On Temp.Empid = Merge.Empid
When Matched Then
Update Set temp.Empid = merge.Empid,
temp.FirstName = merge.FirstName,
temp.LastName = merge.LastName
When Not Matched Then
Insert (Empid,FirstName,LastName)
Values(Merge.Empid,Merge.FirstName,Merge.LastName);