IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PMTS_TASK' AND KSQL_COL_NAME ='FPROJECTSTAGE') 
ALTER TABLE T_PMTS_TASK ADD (FPROJECTSTAGE BIGINT DEFAULT 0 NOT NULL);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PMTS_TASK' AND KSQL_COL_NAME ='FDEVICES') 
ALTER TABLE T_PMTS_TASK ADD (FDEVICES BIGINT DEFAULT 0 NOT NULL);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PMTS_TASK' AND KSQL_COL_NAME ='FWORKPACKAGE') 
ALTER TABLE T_PMTS_TASK ADD (FWORKPACKAGE BIGINT DEFAULT 0 NOT NULL);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PMTS_TASK' AND KSQL_COL_NAME ='FWORKRANGE') 
ALTER TABLE T_PMTS_TASK ADD (FWORKRANGE BIGINT DEFAULT 0 NOT NULL);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PMTS_TASK' AND KSQL_COL_NAME ='FPROFESSION') 
ALTER TABLE T_PMTS_TASK ADD (FPROFESSION BIGINT DEFAULT 0 NOT NULL);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PMTS_TASK' AND KSQL_COL_NAME ='FFUNLOCATION') 
ALTER TABLE T_PMTS_TASK ADD (FFUNLOCATION BIGINT DEFAULT 0 NOT NULL);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PMTS_TASK' AND KSQL_COL_NAME ='FPLANNER') 
ALTER TABLE T_PMTS_TASK ADD (FPLANNER BIGINT DEFAULT 0 NOT NULL);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PMTS_TASK' AND KSQL_COL_NAME ='FISSPECIAL') 
ALTER TABLE T_PMTS_TASK ADD (FISSPECIAL CHAR(1) DEFAULT '0' NOT NULL);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PMTS_TASK' AND KSQL_COL_NAME ='FBIZTYPE') 
ALTER TABLE T_PMTS_TASK ADD (FBIZTYPE NVARCHAR(30) DEFAULT ' ' NOT NULL);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PMTS_TASK' AND KSQL_COL_NAME ='FPLANTYPE') 
ALTER TABLE T_PMTS_TASK ADD (FPLANTYPE BIGINT DEFAULT 0 NOT NULL);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PMTS_TASK' AND KSQL_COL_NAME ='FVERSIONID') 
ALTER TABLE T_PMTS_TASK ADD (FVERSIONID BIGINT DEFAULT 0 NOT NULL);
