
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FMM_STANDARDTASK_TYPE')
CREATE TABLE T_FMM_STANDARDTASK_TYPE
(
	  FPKID                       BIGINT                      DEFAULT 0       NOT NULL,          	
	  FID                         BIGINT                      DEFAULT 0       NOT NULL,          	
	  FBASEDATAID                 BIGINT                      DEFAULT 0       NOT NULL        	
);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FMM_STANDARDTASKENTRY' AND KSQL_COL_NAME ='FCARDNO') 
 ALTER TABLE T_FMM_STANDARDTASKENTRY ADD (FCARDNO NVARCHAR(50) DEFAULT ' ' NOT NULL );
 
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FMM_STANDARDTASKENTRY' AND KSQL_COL_NAME ='FCARDTITLE') 
 ALTER TABLE T_FMM_STANDARDTASKENTRY ADD (FCARDTITLE NVARCHAR(50) DEFAULT ' ' NOT NULL );
 
 
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PMPD_PROJECT_MCC' AND KSQL_COL_NAME ='FPROJECTSCHEME') 
 ALTER TABLE T_PMPD_PROJECT_MCC ADD (FPROJECTSCHEME NVARCHAR(255) DEFAULT ' ' NOT NULL );
 
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PMPD_PROJECT_MCC' AND KSQL_COL_NAME ='FFIXDEVICETYPE') 
 ALTER TABLE T_PMPD_PROJECT_MCC ADD (FFIXDEVICETYPE BIGINT DEFAULT 0 NOT NULL );
 
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PMPD_PROJECT_MCC' AND KSQL_COL_NAME ='FFIXLEVEL') 
 ALTER TABLE T_PMPD_PROJECT_MCC ADD (FFIXLEVEL BIGINT DEFAULT 0 NOT NULL );
 