CREATE TABLE LD0P0PROCESSMETADATA
(
	ID INT IDENTITY(1,1) NOT NULL,
	OWNERID INT NOT NULL,
	MODIFIEDBY VARCHAR(100) NOT NULL,
	PROCESSID INT NOT NULL,
	SELECTEDSTEPINDEX INT NOT NULL,
	COMPLETEDSTEPINDEX INT NOT NULL,
	ISPROCESSCOMPLETED DECIMAL(1) NOT NULL,
	PERSONKEY  INT DEFAULT 0 NOT NULL,
	PREVIOUSMETADATAID INT NOT NULL,
	CASEWORKERID VARCHAR(100) NULL,
	COCASEWORKERID VARCHAR(100) NULL, 
	STARTDATE VARCHAR(8) DEFAULT '20100101' NOT NULL, 
	ENDDATE VARCHAR(8) NULL,
	ORGANIZATIONID INT NULL,
	CASEWORKERORGUNITID VARCHAR(10) NULL,
	COCASEWORKERORGUNITID VARCHAR(10) NULL,
	SERVICECATEGORYOID VARCHAR(201) NULL,
	CASEID INT NULL,
	SERVICETYPEOID VARCHAR(201) NULL,
	CONSTRAINT 		LD0P0PROCESSMETADATA_PKID PRIMARY KEY (ID),
	FOREIGN KEY (PROCESSID) REFERENCES LD0P0PROCESS(ID)
);

