-- Licensed Materials - Property of IBM
-- BI and PM: Mobile
-- (C) Copyright IBM Corp. 2007, 2012
-- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.

CREATE TRIGGER [TGR_MOB_RDS_SYNC_UP] ON [MOB_RENDERS]
AFTER UPDATE
AS
BEGIN
	DECLARE @rds_render_id int
	IF (SELECT COUNT(*) FROM inserted) > 0
	BEGIN
		IF (UPDATE(RENDER_SIZE))
		BEGIN
			SELECT @rds_render_id = RENDER_ID
				FROM inserted
			UPDATE MOB_USER_RENDER SET LAST_VIEWED = GETDATE() 
				WHERE RENDER_ID = @rds_render_id;
		END;
	END;
END;