/**Begin C:\PDM_UPGRADE\sharepdmdir\pbd\pdm1\PBD_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PBD_BUSI_ABNENTITY' AND KSQL_COL_NAME IN ('FABNHISTORY')) 
 ALTER TABLE T_PBD_BUSI_ABNENTITY ADD (FABNHISTORY CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PBD_BUSI_BRANCHENTITY' AND KSQL_COL_NAME IN ('FBRANTHIRDPK')) 
 ALTER TABLE T_PBD_BUSI_BRANCHENTITY ADD (FBRANTHIRDPK VARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PBD_BUSI_COURTANENTITY' AND KSQL_COL_NAME IN ('FBITNTHIRDPK')) 
 ALTER TABLE T_PBD_BUSI_COURTANENTITY ADD (FBITNTHIRDPK VARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PBD_BUSI_COURTANENTITY' AND KSQL_COL_NAME IN ('FBLTNTHISTORY')) 
 ALTER TABLE T_PBD_BUSI_COURTANENTITY ADD (FBLTNTHISTORY CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PBD_BUSI_COURTREGENTITY' AND KSQL_COL_NAME IN ('FCOURTTHIRDPK')) 
 ALTER TABLE T_PBD_BUSI_COURTREGENTITY ADD (FCOURTTHIRDPK VARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PBD_BUSI_DISHONENTITY' AND KSQL_COL_NAME IN ('FDISHONESTTHIRDPK')) 
 ALTER TABLE T_PBD_BUSI_DISHONENTITY ADD (FDISHONESTTHIRDPK VARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PBD_BUSI_DISHONENTITY' AND KSQL_COL_NAME IN ('FDISHONESTHISTORY')) 
 ALTER TABLE T_PBD_BUSI_DISHONENTITY ADD (FDISHONESTHISTORY CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PBD_BUSI_EXEENTITY' AND KSQL_COL_NAME IN ('FEXECTHIRDPK')) 
 ALTER TABLE T_PBD_BUSI_EXEENTITY ADD (FEXECTHIRDPK VARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PBD_BUSI_EXEENTITY' AND KSQL_COL_NAME IN ('FEXECHISTORY')) 
 ALTER TABLE T_PBD_BUSI_EXEENTITY ADD (FEXECHISTORY CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PBD_BUSI_HOLDERENTITY' AND KSQL_COL_NAME IN ('FHOLDERTHIRDPK')) 
 ALTER TABLE T_PBD_BUSI_HOLDERENTITY ADD (FHOLDERTHIRDPK VARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PBD_BUSI_HOLDERENTITY' AND KSQL_COL_NAME IN ('FHOLDERHISTORY')) 
 ALTER TABLE T_PBD_BUSI_HOLDERENTITY ADD (FHOLDERHISTORY CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PBD_BUSI_ILLEGALENTITY' AND KSQL_COL_NAME IN ('FPUTHISTORY')) 
 ALTER TABLE T_PBD_BUSI_ILLEGALENTITY ADD (FPUTHISTORY CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PBD_BUSI_KTANENTITY' AND KSQL_COL_NAME IN ('FKTTHIRDPK')) 
 ALTER TABLE T_PBD_BUSI_KTANENTITY ADD (FKTTHIRDPK VARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PBD_BUSI_KTANENTITY' AND KSQL_COL_NAME IN ('FKTHISTORY')) 
 ALTER TABLE T_PBD_BUSI_KTANENTITY ADD (FKTHISTORY CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PBD_BUSI_NEWSENTITY' AND KSQL_COL_NAME IN ('FNEWSTHIRDPK')) 
 ALTER TABLE T_PBD_BUSI_NEWSENTITY ADD (FNEWSTHIRDPK CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PBD_BUSI_PUNISHENTITY' AND KSQL_COL_NAME IN ('FPUNISHTHIRDPK')) 
 ALTER TABLE T_PBD_BUSI_PUNISHENTITY ADD (FPUNISHTHIRDPK VARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PBD_BUSI_PUNISHENTITY' AND KSQL_COL_NAME IN ('FPUNISHHISTORY')) 
 ALTER TABLE T_PBD_BUSI_PUNISHENTITY ADD (FPUNISHHISTORY CHAR(1) DEFAULT '0' NOT NULL );

/**End C:\PDM_UPGRADE\sharepdmdir\pbd\pdm1\PBD_table.sql **/
