IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SUPPLIER_L' AND KSQL_COL_NAME ='FADDRESS') 
 ALTER TABLE T_BD_SUPPLIER_L ADD (FADDRESS NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SUPPLIER_L' AND KSQL_COL_NAME ='FLINKMAN') 
 ALTER TABLE T_BD_SUPPLIER_L ADD (FLINKMAN NVARCHAR(60) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SUPPLIER_L' AND KSQL_COL_NAME ='FARTIFICIALPERSON') 
 ALTER TABLE T_BD_SUPPLIER_L ADD (FARTIFICIALPERSON NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SUPPLIER_L' AND KSQL_COL_NAME ='FREGCAPITAL') 
 ALTER TABLE T_BD_SUPPLIER_L ADD (FREGCAPITAL NVARCHAR(20) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SUPPLIER_L' AND KSQL_COL_NAME ='FBUSINESSTERM') 
 ALTER TABLE T_BD_SUPPLIER_L ADD (FBUSINESSTERM NVARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SUPPLIER_L' AND KSQL_COL_NAME ='FBUSINESSSCOPE') 
 ALTER TABLE T_BD_SUPPLIER_L ADD (FBUSINESSSCOPE NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SUPPLIER' AND KSQL_COL_NAME ='FBIZFUNCTION') 
 ALTER TABLE T_BD_SUPPLIER ADD (FBIZFUNCTION VARCHAR(20) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SUPPLIER' AND KSQL_COL_NAME ='FPURCHASEHOLD') 
 ALTER TABLE T_BD_SUPPLIER ADD (FPURCHASEHOLD CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SUPPLIER' AND KSQL_COL_NAME ='FINVOICEHOLD') 
 ALTER TABLE T_BD_SUPPLIER ADD (FINVOICEHOLD CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SUPPLIER' AND KSQL_COL_NAME ='FTYPE') 
 ALTER TABLE T_BD_SUPPLIER ADD (FTYPE VARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SUPPLIER' AND KSQL_COL_NAME ='FPAYHOLD') 
 ALTER TABLE T_BD_SUPPLIER ADD (FPAYHOLD CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SUPPLIER' AND KSQL_COL_NAME ='FINVOICETYPE') 
 ALTER TABLE T_BD_SUPPLIER ADD (FINVOICETYPE CHAR(1) DEFAULT '0' NOT NULL );

 EXEC p_AlterColumn 'T_BD_BIZPARTNER', 'FPOSTALCODE', 'NVARCHAR(50)', 'NOT NULL', '0100', ''' ''';

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_BIZPARTNER' AND KSQL_COL_NAME ='FPARTNERROLE') 
 ALTER TABLE T_BD_BIZPARTNER ADD (FPARTNERROLE NVARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_BIZPARTNER' AND KSQL_COL_NAME ='FADMINDIVISION') 
 ALTER TABLE T_BD_BIZPARTNER ADD (FADMINDIVISION NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BD_SUPPLIER_B') 
 CREATE TABLE T_BD_SUPPLIER_B (
FID BIGINT DEFAULT 0 NOT NULL,
FCOUNTRYID BIGINT DEFAULT 0 NOT NULL,
FPOSTALCODE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FPHONE NVARCHAR(60) DEFAULT ' ' NOT NULL,
FFAX NVARCHAR(40) DEFAULT ' ' NOT NULL,
FURL NVARCHAR(255) DEFAULT ' ' NOT NULL,
FSOCIETYCREDITCODE NVARCHAR(255) DEFAULT ' ' NOT NULL,
FORGCODE NVARCHAR(255) DEFAULT ' ' NOT NULL,
FBIZREGISTERNO NVARCHAR(255) DEFAULT ' ' NOT NULL,
FTXREGISTERNO NVARCHAR(255) DEFAULT ' ' NOT NULL,
FINTERNALCOMPANYID BIGINT DEFAULT 0 NOT NULL,
FESTABLISHDATE DATETIME,
FADMINDIVISION NVARCHAR(100) DEFAULT ' ' NOT NULL
);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BD_SUPPLIERSITEBANK') 
 CREATE TABLE T_BD_SUPPLIERSITEBANK (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FBANKID BIGINT DEFAULT 0 NOT NULL,
FBANKACCOUNT NVARCHAR(80) DEFAULT ' ' NOT NULL,
FCURRENCYID BIGINT DEFAULT 0 NOT NULL,
FBANKACCOUNTTYPE NVARCHAR(120) DEFAULT ' ' NOT NULL,
FSETTLMENT BIGINT DEFAULT 0 NOT NULL,
FCOMMISSIONBEARER NVARCHAR(30) DEFAULT ' ' NOT NULL,
FLIQUIDATIONPARAM NVARCHAR(125) DEFAULT ' ' NOT NULL,
FAGENTBANK BIGINT DEFAULT 0 NOT NULL,
FAGENTBANKACCOUNT NVARCHAR(80) DEFAULT ' ' NOT NULL,
FISDEFAULT CHAR(1) DEFAULT '0' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BD_SUPPLIERSITEBANK_L') 
 CREATE TABLE T_BD_SUPPLIERSITEBANK_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FACCOUNTNAME NVARCHAR(80) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BD_SUPPLIERADDRESS_L') 
 CREATE TABLE T_BD_SUPPLIERADDRESS_L (
FPKID NVARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FPHONE NVARCHAR(100) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BD_SUPPLIERSITE_L') 
 CREATE TABLE T_BD_SUPPLIERSITE_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL
);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BD_SUPPLIERADDRESS') 
 CREATE TABLE T_BD_SUPPLIERADDRESS (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(100) DEFAULT ' ' NOT NULL,
FADMINDIVISION NVARCHAR(50) DEFAULT ' ' NOT NULL,
FDETAILADDRESS NVARCHAR(300) DEFAULT ' ' NOT NULL,
FLINKMAN NVARCHAR(100) DEFAULT ' ' NOT NULL,
FADDEMAIL NVARCHAR(100) DEFAULT ' ' NOT NULL,
FTIMEZONE BIGINT DEFAULT 0 NOT NULL,
FINTEPROGRAMME BIGINT DEFAULT 0 NOT NULL,
FSUPPLIERID NVARCHAR(100) DEFAULT ' ' NOT NULL
);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SUPPLIER' AND KSQL_COL_NAME ='FEMPLOYEE') 
 ALTER TABLE T_BD_SUPPLIER ADD (FEMPLOYEE BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SUPPLIER' AND KSQL_COL_NAME ='FPAYMENTUNIT') 
 ALTER TABLE T_BD_SUPPLIER ADD (FPAYMENTUNIT VARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BD_SUPPLIERSITE') 
 CREATE TABLE T_BD_SUPPLIERSITE (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(60) DEFAULT ' ' NOT NULL,
FSTATUS VARCHAR(30) DEFAULT ' ' NOT NULL,
FCREATEORGID BIGINT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE CHAR(1) DEFAULT '1' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FUSEORGID BIGINT DEFAULT 0 NOT NULL,
FCTRLSTRATEGY VARCHAR(10) DEFAULT ' ' NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FSUPPLIERID BIGINT DEFAULT 0 NOT NULL,
FPURCHASERID BIGINT DEFAULT 0 NOT NULL,
FPURCHASEDEPTID BIGINT DEFAULT 0 NOT NULL,
FSETTLEMENTCYID BIGINT DEFAULT 0 NOT NULL,
FDELIVERSUPPLIERID BIGINT DEFAULT 0 NOT NULL,
FTAXTYPE VARCHAR(10) DEFAULT ' ' NOT NULL,
FMALLSTATUS VARCHAR(10) DEFAULT ' ' NOT NULL,
FMALLDATE DATETIME,
FISSUPPCOLLA CHAR(1) DEFAULT '0' NOT NULL,
FTAXRATEID BIGINT DEFAULT 0 NOT NULL,
FENABLEVMI CHAR(1) DEFAULT '0' NOT NULL,
FRECEIVINGSUPPLIERID BIGINT DEFAULT 0 NOT NULL,
FSETTLEMENTTYPEID BIGINT DEFAULT 0 NOT NULL,
FPAYMENTCURRENCY BIGINT DEFAULT 0 NOT NULL,
FPAYMENTCONDID BIGINT DEFAULT 0 NOT NULL,
FINVOICESUPPLIERID BIGINT DEFAULT 0 NOT NULL,
FPURCHASEHOLD CHAR(1) DEFAULT '0' NOT NULL,
FINVOICEHOLD CHAR(1) DEFAULT '0' NOT NULL,
FPAYHOLD CHAR(1) DEFAULT '0' NOT NULL,
FINVOICETYPE CHAR(1) DEFAULT '0' NOT NULL,
FADDRESS BIGINT DEFAULT 0 NOT NULL,
FBIZFUNCTION VARCHAR(20) DEFAULT ' ' NOT NULL,
FPAYMENTUNIT VARCHAR(30) DEFAULT ' ' NOT NULL
);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SUPPLIERSITE' AND KSQL_COL_NAME ='FMATCHINGRULE') 
 ALTER TABLE T_BD_SUPPLIERSITE ADD (FMATCHINGRULE VARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SUPPLIERSITE' AND KSQL_COL_NAME ='FBILLADDRESS') 
 ALTER TABLE T_BD_SUPPLIERSITE ADD (FBILLADDRESS BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SUPPLIERSITE' AND KSQL_COL_NAME ='FINVOICEADDRESS') 
 ALTER TABLE T_BD_SUPPLIERSITE ADD (FINVOICEADDRESS BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SUPPLIERADDRESS' AND KSQL_COL_NAME ='FCUSTOMERID') 
 ALTER TABLE T_BD_SUPPLIERADDRESS ADD (FCUSTOMERID NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SUPPLIERADDRESS' AND KSQL_COL_NAME ='FCREATETIME') 
 ALTER TABLE T_BD_SUPPLIERADDRESS ADD (FCREATETIME DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SUPPLIERADDRESS' AND KSQL_COL_NAME ='FCREATORID') 
 ALTER TABLE T_BD_SUPPLIERADDRESS ADD (FCREATORID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SUPPLIERADDRESS' AND KSQL_COL_NAME ='FMODIFYTIME') 
 ALTER TABLE T_BD_SUPPLIERADDRESS ADD (FMODIFYTIME DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SUPPLIERADDRESS' AND KSQL_COL_NAME ='FMODIFIERID') 
 ALTER TABLE T_BD_SUPPLIERADDRESS ADD (FMODIFIERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SUPPLIERADDRESS' AND KSQL_COL_NAME ='FDISABLEDATE') 
 ALTER TABLE T_BD_SUPPLIERADDRESS ADD (FDISABLEDATE DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SUPPLIERADDRESS' AND KSQL_COL_NAME ='FDISABLERID') 
 ALTER TABLE T_BD_SUPPLIERADDRESS ADD (FDISABLERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SUPPLIERADDRESS' AND KSQL_COL_NAME ='FENABLE') 
 ALTER TABLE T_BD_SUPPLIERADDRESS ADD (FENABLE NVARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SUPPLIERADDRESS' AND KSQL_COL_NAME ='FSTATUS') 
 ALTER TABLE T_BD_SUPPLIERADDRESS ADD (FSTATUS NVARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SUPPLIERADDRESS' AND KSQL_COL_NAME ='FISSUPPLIERADD') 
 ALTER TABLE T_BD_SUPPLIERADDRESS ADD (FISSUPPLIERADD CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SUPPLIERADDRESS' AND KSQL_COL_NAME ='FISCUSTOMERADD') 
 ALTER TABLE T_BD_SUPPLIERADDRESS ADD (FISCUSTOMERADD CHAR(1) DEFAULT '0' NOT NULL );
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SUPPLIER' AND KSQL_COL_NAME ='FMATCHINGRULE') 
 ALTER TABLE T_BD_SUPPLIER ADD (FMATCHINGRULE VARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SUPPLIER' AND KSQL_COL_NAME ='FBILLADDRESS') 
 ALTER TABLE T_BD_SUPPLIER ADD (FBILLADDRESS BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SUPPLIER' AND KSQL_COL_NAME ='FINVOICEADDRESS') 
 ALTER TABLE T_BD_SUPPLIER ADD (FINVOICEADDRESS BIGINT DEFAULT 0 NOT NULL );
 
 
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SUPPLIERLINKMAN' AND KSQL_COL_NAME ='FROLE') 
 ALTER TABLE T_BD_SUPPLIERLINKMAN ADD (FROLE NVARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SUPPLIERLINKMAN' AND KSQL_COL_NAME ='FINVALID') 
 ALTER TABLE T_BD_SUPPLIERLINKMAN ADD (FINVALID CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SUPPLIERADDRESS' AND KSQL_COL_NAME ='FZIPCODE') 
 ALTER TABLE T_BD_SUPPLIERADDRESS ADD (FZIPCODE NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SUPPLIERADDRESS' AND KSQL_COL_NAME ='FINVALID') 
 ALTER TABLE T_BD_SUPPLIERADDRESS ADD (FINVALID CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SUPPLIERADDRESS' AND KSQL_COL_NAME ='FDEFAULT') 
 ALTER TABLE T_BD_SUPPLIERADDRESS ADD (FDEFAULT CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SUPPLIERADDRESS' AND KSQL_COL_NAME ='FBIZPARTNERID') 
 ALTER TABLE T_BD_SUPPLIERADDRESS ADD (FBIZPARTNERID BIGINT DEFAULT 0 NOT NULL );
 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_BD_SUPPLIERADDRESS', 'FINTEPROGRAMME', 'NULL', 'NULL', '1001', 'NULL';

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SUPPLIERSITE' AND KSQL_COL_NAME ='FRECEIVERADDRESS') 
 ALTER TABLE T_BD_SUPPLIERSITE ADD (FRECEIVERADDRESS BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SUPPLIERSITE' AND KSQL_COL_NAME ='FREIGHTTYPE') 
 ALTER TABLE T_BD_SUPPLIERSITE ADD (FREIGHTTYPE NVARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SUPPLIERSITE' AND KSQL_COL_NAME ='FPRICECLAUSE') 
 ALTER TABLE T_BD_SUPPLIERSITE ADD (FPRICECLAUSE BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SUPPLIERSITE' AND KSQL_COL_NAME ='FSCSTYPE') 
 ALTER TABLE T_BD_SUPPLIERSITE ADD (FSCSTYPE BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SUPPLIERSITE' AND KSQL_COL_NAME ='FRATETYPE') 
 ALTER TABLE T_BD_SUPPLIERSITE ADD (FRATETYPE NVARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SUPPLIERSITE' AND KSQL_COL_NAME ='FSUPMASTERID') 
 ALTER TABLE T_BD_SUPPLIERSITE ADD (FSUPMASTERID NVARCHAR(100) DEFAULT ' ' NOT NULL );
 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_BD_SUPPLIERSITE', 'FPURCHASERID', 'NULL', 'NULL', '1001', 'NULL';

 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_BD_SUPPLIERSITE', 'FPURCHASEDEPTID', 'NULL', 'NULL', '1001', 'NULL';

 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_BD_SUPPLIERSITE', 'FDELIVERSUPPLIERID', 'NULL', 'NULL', '1001', 'NULL';

 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_BD_SUPPLIERSITE', 'FTAXTYPE', 'NULL', 'NULL', '1001', 'NULL';

 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_BD_SUPPLIERSITE', 'FMALLSTATUS', 'NULL', 'NULL', '1001', 'NULL';

 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_BD_SUPPLIERSITE', 'FMALLDATE', 'NULL', 'NULL', '1001', 'NULL';

 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_BD_SUPPLIERSITE', 'FISSUPPCOLLA', 'NULL', 'NULL', '1001', 'NULL';

 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_BD_SUPPLIERSITE', 'FENABLEVMI', 'NULL', 'NULL', '1001', 'NULL';

 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_BD_SUPPLIERSITE', 'FRECEIVINGSUPPLIERID', 'NULL', 'NULL', '1001', 'NULL';

 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_BD_SUPPLIERSITE', 'FINVOICESUPPLIERID', 'NULL', 'NULL', '1001', 'NULL';

 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_BD_SUPPLIERSITE', 'FPURCHASEHOLD', 'NULL', 'NULL', '1001', 'NULL';

 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_BD_SUPPLIERSITE', 'FINVOICEHOLD', 'NULL', 'NULL', '1001', 'NULL';

 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_BD_SUPPLIERSITE', 'FPAYHOLD', 'NULL', 'NULL', '1001', 'NULL';

 EXEC p_AlterColumn 'T_BD_BIZPARTNER_L', 'FBUSINESSSCOPE', 'NVARCHAR(2000)', 'NOT NULL', '0100', ''' ''';

 EXEC p_AlterColumn 'T_BD_SUPPLIER_L', 'FBUSINESSSCOPE', 'NVARCHAR(2000)', 'NOT NULL', '0100', ''' ''';

 
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_BIZPARTNER' AND KSQL_COL_NAME ='FIDNO') 
 ALTER TABLE T_BD_BIZPARTNER ADD (FIDNO NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SUPPLIER_B' AND KSQL_COL_NAME ='FIDNO') 
 ALTER TABLE T_BD_SUPPLIER_B ADD (FIDNO NVARCHAR(50) DEFAULT ' ' NOT NULL );
 