/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\EB_table.sql **/
 EXEC p_AlterColumn 'T_EB_BGCONTROLOPERLOG', 'FPARAMS', 'CHAR(1)', 'NOT NULL', '0010', '''0''';

 EXEC p_AlterColumn 'T_EB_SCHEMECATALOG_L', 'FPKID', 'NVARCHAR(36)', 'NOT NULL', '0001', ''' ''';

 EXEC p_AlterColumn 'T_EB_SCHEMECATALOG_L', 'FID', 'BIGINT', 'NOT NULL', '0001', '0';

 EXEC p_AlterColumn 'T_EB_SCHEMECATALOG_L', 'FLOCALEID', 'NVARCHAR(10)', 'NOT NULL', '1111', ''' ''';

 EXEC p_AlterColumn 'T_EB_SCHEMECATALOG_L', 'FNAME', 'NVARCHAR(255)', 'NOT NULL', '0001', ''' ''';

 EXEC p_AlterColumn 'T_EB_SCHEMEENTRY_L', 'FPKID', 'NVARCHAR(36)', 'NOT NULL', '0001', ''' ''';

 EXEC p_AlterColumn 'T_EB_SCHEMEENTRY_L', 'FID', 'BIGINT', 'NOT NULL', '0001', '0';

 EXEC p_AlterColumn 'T_EB_SCHEMEENTRY_L', 'FLOCALEID', 'NVARCHAR(10)', 'NOT NULL', '1111', ''' ''';

 EXEC p_AlterColumn 'T_EB_SCHEMEENTRY_L', 'FNAME', 'NVARCHAR(255)', 'NOT NULL', '0001', ''' ''';

 EXEC p_AlterColumn 'T_EB_SCHEMEDIMMAP', 'FID', 'BIGINT', 'NOT NULL', '0001', '0';

 EXEC p_AlterColumn 'T_EB_SCHEMEDIMMAP', 'FENTRYID', 'BIGINT', 'NOT NULL', '0001', '0';

 EXEC p_AlterColumn 'T_EB_SCHEMEDIMMAP', 'FSEQ', 'INT', 'NOT NULL', '0001', '0';

 EXEC p_AlterColumn 'T_EB_SCHEMEDIMMAP', 'FDIMPROP', 'NVARCHAR(255)', 'NOT NULL', '0001', ''' ''';

 EXEC p_AlterColumn 'T_EB_SCHEMEDIMMAP', 'FDIMNUMBER', 'NVARCHAR(255)', 'NOT NULL', '0001', ''' ''';

 EXEC p_AlterColumn 'T_EB_SCHEMEDIMMAP', 'FTARGETFIELDNAME', 'NVARCHAR(255)', 'NOT NULL', '0001', ''' ''';

 EXEC p_AlterColumn 'T_EB_SCHEMEDIMMAP', 'FTARGETFIELDNUM', 'NVARCHAR(255)', 'NOT NULL', '0001', ''' ''';

 EXEC p_AlterColumn 'T_EB_SCHEMEDIMMAP', 'FDIM', 'BIGINT', 'NOT NULL', '0001', '0';

 EXEC p_AlterColumn 'T_EB_SCHEMEDIMMAP', 'FISPK', 'CHAR(1)', 'NOT NULL', '0001', '''0''';

 EXEC p_AlterColumn 'T_EB_SCHEMEENTRY', 'FID', 'BIGINT', 'NOT NULL', '0001', '0';

 EXEC p_AlterColumn 'T_EB_SCHEMEENTRY', 'FTARGETTABLE', 'BIGINT', 'NOT NULL', '0001', '0';

 EXEC p_AlterColumn 'T_EB_SCHEMEENTRY', 'FNUMBER', 'NVARCHAR(255)', 'NOT NULL', '0001', ''' ''';

 EXEC p_AlterColumn 'T_EB_SCHEMEENTRY', 'FSCHEMECATALOG', 'BIGINT', 'NOT NULL', '0001', '0';

 EXEC p_AlterColumn 'T_EB_SCHEMEENTRY', 'FMODIFIERFIELD', 'BIGINT', 'NOT NULL', '0011', '0';

 EXEC p_AlterColumn 'T_EB_SCHEMEENTRY', 'FISCSCHEMETRIGGER', 'BIGINT', 'NOT NULL', '0001', '0';

 EXEC p_AlterColumn 'T_EB_SCHEMECATALOG', 'FID', 'BIGINT', 'NOT NULL', '0001', '0';

 EXEC p_AlterColumn 'T_EB_SCHEMECATALOG', 'FLEVEL', 'INT', 'NOT NULL', '0011', '0';

 EXEC p_AlterColumn 'T_EB_SCHEMECATALOG', 'FLONGNUMBER', 'NVARCHAR(255)', 'NOT NULL', '0011', ''' ''';

 EXEC p_AlterColumn 'T_EB_SCHEMECATALOG', 'FISLEAF', 'CHAR(1)', 'NOT NULL', '0011', '''0''';

 EXEC p_AlterColumn 'T_EB_SCHEMECATALOG', 'FNUMBER', 'NVARCHAR(255)', 'NOT NULL', '0001', ''' ''';

 EXEC p_AlterColumn 'T_EB_SCHEMECATALOG', 'FMODELID', 'BIGINT', 'NOT NULL', '0001', '0';

 EXEC p_AlterColumn 'T_EB_SCHEMECATALOG', 'FPARENTID', 'BIGINT', 'NOT NULL', '0001', '0';

 EXEC p_AlterColumn 'T_EB_SCHEMECATALOG', 'FMASTERID', 'BIGINT', 'NOT NULL', '0011', '0';

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

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_FORMULAREFER') 
 CREATE TABLE T_EB_FORMULAREFER (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FREFERACCOUNT BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL
);

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

 --- drop TABLE --------- 请认真检查该脚本 ------------------- 
IF EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_FORMULACONDITION') 
 DROP TABLE T_EB_FORMULACONDITION;

 --- drop TABLE --------- 请认真检查该脚本 ------------------- 
IF EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_FORMULAVARIATE') 
 DROP TABLE T_EB_FORMULAVARIATE;


/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\EB_table.sql **/
