SQL-SERVER trigger to update datetimefield automatically

علی ذوالفقار
1400/04/21 09:26:14 (57)
CREATE TRIGGER [TR_SET_UPDATE_DATETIME] 
ON [TBL_TEST]
FOR UPDATE
AS
BEGIN
	DECLARE @id int 
	SELECT  @id = id FROM inserted 	
	UPDATE  tbl_file_request SET up_datetime = GETDATE() WHERE id = @id 	
END
Back