
UPDATE TBDD_MODULES SET PRODUCT_VERSION = '1.1.0.0' where SHORT_NAME = 'UM'
GO
CREATE TABLE TBUM_AD_COMMAND
(
	GUID			INTEGER	IDENTITY(1,1),    
	AD_CMD_NAME     VARCHAR(250),
	COMMAND_STRING	VARCHAR(MAX),
	ADDED_WHO		VARCHAR(50)		DEFAULT 'DEFAULT'		NOT NULL,
	ADDED_WHEN		DATETIME 		DEFAULT GETDATE(),
	CHANGED_WHO		VARCHAR(50),
	CHANGED_WHEN	DATETIME,
	CONSTRAINT		PK_TBUM_AD_COMMAND	PRIMARY KEY (GUID),
	CONSTRAINT		UC_TBUM_AD_COMMAND UNIQUE (AD_CMD_NAME),
)
GO
CREATE TRIGGER TBUM_AD_COMMAND_AFT_UPD ON TBUM_AD_COMMAND
FOR UPDATE
AS
	UPDATE TBUM_AD_COMMAND SET CHANGED_WHEN = GETDATE() FROM INSERTED 
	WHERE TBUM_AD_COMMAND.GUID = INSERTED.GUID
GO
