/**Begin D:\PDM_UPGRADE\PDM1\BASE_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SUPPLIERLINKMAN' AND KSQL_COL_NAME ='FFAMILYNAME') 
 ALTER TABLE T_BD_SUPPLIERLINKMAN ADD (FFAMILYNAME NVARCHAR(150) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SUPPLIERLINKMAN' AND KSQL_COL_NAME ='FGIVENNAME') 
 ALTER TABLE T_BD_SUPPLIERLINKMAN ADD (FGIVENNAME NVARCHAR(150) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SUPPLIERLINKMAN' AND KSQL_COL_NAME ='FMIDDLENAME') 
 ALTER TABLE T_BD_SUPPLIERLINKMAN ADD (FMIDDLENAME NVARCHAR(150) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SUPPLIERLINKMAN' AND KSQL_COL_NAME ='FALIAS') 
 ALTER TABLE T_BD_SUPPLIERLINKMAN ADD (FALIAS NVARCHAR(150) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SUPPLIERLINKMAN' AND KSQL_COL_NAME ='FASSOCIATEDADDRESS') 
 ALTER TABLE T_BD_SUPPLIERLINKMAN ADD (FASSOCIATEDADDRESS BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SUPPLIERLINKMAN' AND KSQL_COL_NAME ='FADDRESSPURPOSE') 
 ALTER TABLE T_BD_SUPPLIERLINKMAN ADD (FADDRESSPURPOSE BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_CUSTOMERLINKMAN' AND KSQL_COL_NAME ='FFAMILYNAME') 
 ALTER TABLE T_BD_CUSTOMERLINKMAN ADD (FFAMILYNAME NVARCHAR(150) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_CUSTOMERLINKMAN' AND KSQL_COL_NAME ='FGIVENNAME') 
 ALTER TABLE T_BD_CUSTOMERLINKMAN ADD (FGIVENNAME NVARCHAR(150) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_CUSTOMERLINKMAN' AND KSQL_COL_NAME ='FMIDDLENAME') 
 ALTER TABLE T_BD_CUSTOMERLINKMAN ADD (FMIDDLENAME NVARCHAR(150) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_CUSTOMERLINKMAN' AND KSQL_COL_NAME ='FALIAS') 
 ALTER TABLE T_BD_CUSTOMERLINKMAN ADD (FALIAS NVARCHAR(150) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_CUSTOMERLINKMAN' AND KSQL_COL_NAME ='FASSOCIATEDADDRESS') 
 ALTER TABLE T_BD_CUSTOMERLINKMAN ADD (FASSOCIATEDADDRESS BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_CUSTOMERLINKMAN' AND KSQL_COL_NAME ='FADDRESSPURPOSE') 
 ALTER TABLE T_BD_CUSTOMERLINKMAN ADD (FADDRESSPURPOSE BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_MATERIAL' AND KSQL_COL_NAME ='FOFFERINGCODE') 
 ALTER TABLE T_BD_MATERIAL ADD (FOFFERINGCODE BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SUPPLIERADDRESS' AND KSQL_COL_NAME ='FSUPPLIERADDRSSPURPOSE') 
 ALTER TABLE T_BD_SUPPLIERADDRESS ADD (FSUPPLIERADDRSSPURPOSE BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SUPPLIERADDRESS' AND KSQL_COL_NAME ='FCUSTOMERADDRSSPURPOSE') 
 ALTER TABLE T_BD_SUPPLIERADDRESS ADD (FCUSTOMERADDRSSPURPOSE BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SUPPLIERADDRESS' AND KSQL_COL_NAME ='FLONGITUDE') 
 ALTER TABLE T_BD_SUPPLIERADDRESS ADD (FLONGITUDE NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SUPPLIERADDRESS' AND KSQL_COL_NAME ='FDIMENSIONALITY') 
 ALTER TABLE T_BD_SUPPLIERADDRESS ADD (FDIMENSIONALITY NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SUPPLIERADDRESS' AND KSQL_COL_NAME ='FADMINDIVISIONDATA') 
 ALTER TABLE T_BD_SUPPLIERADDRESS ADD (FADMINDIVISIONDATA BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_CUSTOMERBANK' AND KSQL_COL_NAME ='FIBANID') 
 ALTER TABLE T_BD_CUSTOMERBANK ADD (FIBANID VARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SUPPLIERBANK' AND KSQL_COL_NAME ='FIBANID') 
 ALTER TABLE T_BD_SUPPLIERBANK ADD (FIBANID VARCHAR(50) DEFAULT ' ' NOT NULL );
/**End D:\PDM_UPGRADE\PDM1\BASE_table.sql **/
