Overwriting old data in Azure SQL database
You can use a MERGE statement to perform a conditional INSERT/UPDATE (sometimes called UPSERT) of data in your table.

Example:

MERGE INTO dbo.Output AS Target  
USING (SELECT DeviceId, ParkingStatus FROM IoInput) AS Source (Id, ParkingStatus)  
    ON Target.Id = Source.Id  
WHEN MATCHED THEN  
    UPDATE SET ParkingStatus = Source.ParkingStatus  
WHEN NOT MATCHED BY TARGET THEN  
    INSERT (Id, ParkingStatus) VALUES (Id, ParkingStatus)


This statement will match records in IoInput with existing records in Output. Any matched records will update the ParkingStatus in Output with the value in IoInput. Any unmatched records in IoInput will be inserted into Output.