1
如何使用SQL Server 2005中的其他代碼替換合併查詢,代碼爲 以獲得相同的功能。用一些其他代碼代替SQL Server中的合併
alter trigger [Emp_Update_Logging] on [Employee_Test]
after update
as
MERGE INTO dbo.Emp_Log EL
USING INSERTED I
ON EL.EID = I.Emp_ID
WHEN MATCHED THEN
UPDATE
SET EL.ModifiedDate = getdate()
WHEN NOT MATCHED THEN
INSERT(EID,ModifiedDate)
VALUES(I.Emp_ID,getdate());
go