/**Begin D:\PDM_UPGRADE\PDM1\HBSS_table.sql **/
 EXEC p_AlterColumn 'T_HBSS_DIFFHANDLER', 'FFUNCTIONNAME', 'NVARCHAR(100)', 'NOT NULL', '1111', ''' ''';

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HBSS_DIFFIMPLEMENT' AND KSQL_COL_NAME IN ('FCLOUDID')) 
 ALTER TABLE T_HBSS_DIFFIMPLEMENT ADD (FCLOUDID VARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HBSS_DIFFIMPLEMENT' AND KSQL_COL_NAME IN ('FAPPID')) 
 ALTER TABLE T_HBSS_DIFFIMPLEMENT ADD (FAPPID VARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HBSS_DIFFIMPLEMENT' AND KSQL_COL_NAME IN ('FFUNCTIONNAME')) 
 ALTER TABLE T_HBSS_DIFFIMPLEMENT ADD (FFUNCTIONNAME NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HBSS_DIFFIMPLEMENT' AND KSQL_COL_NAME IN ('FDESCRIPTION')) 
 ALTER TABLE T_HBSS_DIFFIMPLEMENT ADD (FDESCRIPTION NVARCHAR(500) DEFAULT ' ' NOT NULL );
 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_HBSS_DIFFIMPLEMENT', 'FDESC', 'NULL', 'NULL', '1001', 'NULL';

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

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HBSS_DIFFIMPLEMENT_L' AND KSQL_COL_NAME IN ('FFUNCTIONNAME')) 
 ALTER TABLE T_HBSS_DIFFIMPLEMENT_L ADD (FFUNCTIONNAME NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HBSS_DIFFIMPLEMENT_L' AND KSQL_COL_NAME IN ('FDESCRIPTION')) 
 ALTER TABLE T_HBSS_DIFFIMPLEMENT_L ADD (FDESCRIPTION NVARCHAR(500) DEFAULT ' ' NOT NULL );
 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_HBSS_DIFFIMPLEMENT_L', 'FDESC', 'NULL', 'NULL', '1001', 'NULL';

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HBSS_DIFFCUSIMPL') 
 CREATE TABLE T_HBSS_DIFFCUSIMPL (
FID BIGINT DEFAULT 0 NOT NULL,
FDIFFIMPLID BIGINT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FISV VARCHAR(50) DEFAULT ' ' NOT NULL,
FISSYSPRESET CHAR(1) DEFAULT '0' NOT NULL,
FENABLE CHAR(1) DEFAULT '0' NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(500) DEFAULT ' ' NOT NULL,
FSERVICEIMPL VARCHAR(200) DEFAULT ' ' NOT NULL,
FFUNCTIONNAME NVARCHAR(100) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HBSS_DIFFCUSIMPL_L') 
 CREATE TABLE T_HBSS_DIFFCUSIMPL_L (
FPKID VARCHAR(18) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(500) DEFAULT ' ' NOT NULL,
FFUNCTIONNAME NVARCHAR(100) DEFAULT ' ' NOT NULL
);



/**End D:\PDM_UPGRADE\PDM1\HBSS_table.sql **/
