UPDATE TBDD_MODULES SET DB_VERSION = '1.2.0.0' where SHORT_NAME = 'EMLP' 
GO 
CREATE TABLE TBEMLP_HISTORY_STATE
(
GUID					INTEGER		    NOT NULL 	IDENTITY (1, 1),
MESSAGE_ID				VARCHAR(900)	NOT NULL,
STATE_TITLE				VARCHAR(900) 	NOT NULL,
STATE_TITLE1			VARCHAR(900) ,
COMMENT					VARCHAR(3000),
ADDED_WHO				VARCHAR(30)     DEFAULT 'Digital Data',
ADDED_WHEN   			DATETIME 	    DEFAULT (GETDATE()),
CHANGED_WHO				VARCHAR(30),
CHANGED_WHEN			DATETIME,
CONSTRAINT PK_TBEMLP_HISTORY_STATE     	   PRIMARY KEY (GUID)
)
GO
CREATE PROCEDURE PRCUST_ADD_HISTORY_STATE @MessageID VARCHAR(250), @TITLE1 VARCHAR(250), @TITLE2 VARCHAR(250), @COMMENT VARCHAR(3000) = 0
AS 
BEGIN
	INSERT INTO TBEMLP_HISTORY_STATE
		(MESSAGE_ID,STATE_TITLE,STATE_TITLE1,COMMENT) VALUES (@MessageID,@TITLE1,@TITLE2,@COMMENT)
END
GO