SqlServer的Merge语句
CREATE TABLE #TEMP(Id INT,Name NVARCHAR(100));
MERGE INTO Student T USING #TEMP S ON T.Id=S.Id
WHEN MATCHED THEN UPDATE SET Name=S.Name
WHEN NOT MATCHED THEN INSERT VALUES(S.Id,S.HolidayDate)
WHEN NOT MATCHED BY SOURCE AND T.Id BETWEEN 1 AND 31 THEN DELETE;