/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\BCM_table.sql **/
 EXEC p_AlterColumn 'T_BCM_DATACOLLECT', 'FCOLLECTSTATUS', 'VARCHAR(5)', 'NOT NULL', '1111', ''' ''';

 EXEC p_AlterColumn 'T_BCM_ISMAPJSON', 'FTYPE', 'VARCHAR(5)', 'NOT NULL', '1111', ''' ''';

 EXEC p_AlterColumn 'T_BCM_MERGEPROGRESS', 'FSTATUS', 'VARCHAR(5)', 'NOT NULL', '1111', ''' ''';

 EXEC p_AlterColumn 'T_BCM_ISGROUPMAP', 'FCOMPUTEOPRT', 'VARCHAR(5)', 'NOT NULL', '1111', ''' ''';

 EXEC p_AlterColumn 'T_BCM_ISGROUPMAP', 'FSRCTYPE', 'VARCHAR(5)', 'NOT NULL', '1111', ''' ''';

 EXEC p_AlterColumn 'T_BCM_ISSINGLEMAP', 'FSCOPE', 'VARCHAR(5)', 'NOT NULL', '1111', ''' ''';

 EXEC p_AlterColumn 'T_BCM_INTEGRATESCHEME', 'FADAPTER', 'VARCHAR(5)', 'NOT NULL', '1111', ''' ''';

 EXEC p_AlterColumn 'T_BCM_MODELOLAP_RECORD', 'FRUNMODEL', 'VARCHAR(5)', 'NOT NULL', '1111', ''' ''';

 EXEC p_AlterColumn 'T_BCM_MODELOLAP_RECORD', 'FSTORAGETYPE', 'VARCHAR(5)', 'NOT NULL', '1111', ''' ''';

 EXEC p_AlterColumn 'T_BCM_CONVERTDIFFENTITY', 'FPRIORITY', 'VARCHAR(5)', 'NOT NULL', '1111', ''' ''';

 EXEC p_AlterColumn 'T_BCM_GUIDEMENU', 'FCLASSIFICATION', 'VARCHAR(50)', 'NOT NULL', '1111', ''' ''';

 EXEC p_AlterColumn 'T_BCM_TASKDISPTEM', 'FSEQ', 'NVARCHAR(20)', 'NOT NULL', '1111', ''' ''';

 EXEC p_AlterColumn 'T_BCM_CHKMEMBRANGE', 'FLIMITTYPE', 'CHAR(1)', 'NOT NULL', '1111', '''1''';

 EXEC p_AlterColumn 'T_BCM_ENUMVALUE', 'FENUMITEMID', 'NVARCHAR(50)', 'NOT NULL', '1111', ''' ''';

 EXEC p_AlterColumn 'T_BCM_ENUMVALUE', 'FMASTERID', 'NVARCHAR(50)', 'NOT NULL', '1111', ''' ''';

 EXEC p_AlterColumn 'T_BCM_INVRELATIONSET', 'FDIRECTEOWN', 'CHAR(1)', 'NOT NULL', '1111', '''0''';

 EXEC p_AlterColumn 'T_BCM_INVRELATIONSET', 'FINDIREOWNSUM', 'CHAR(1)', 'NOT NULL', '1111', '''0''';

 EXEC p_AlterColumn 'T_BCM_INVRELATIONSET', 'FINDIREOWNMUL', 'CHAR(1)', 'NOT NULL', '1111', '''0''';

 EXEC p_AlterColumn 'T_BCM_INVRELATIONSET', 'FINSHAREEOWN', 'CHAR(1)', 'NOT NULL', '1111', '''0''';

 EXEC p_AlterColumn 'T_BCM_INVRELATIONSET', 'FINTRASHAREEOWN', 'CHAR(1)', 'NOT NULL', '1111', '''0''';

 EXEC p_AlterColumn 'T_BCM_INVRELATIONDEFINE', 'FISSELECTED', 'CHAR(1)', 'NOT NULL', '1111', '''0''';

 EXEC p_AlterColumn 'T_BCM_STRUCTOFACCOUNT', 'FNAME', 'NVARCHAR(500)', 'NOT NULL', '0100', ''' ''';

 EXEC p_AlterColumn 'T_BCM_STRUCTOFACCOUNT', 'FSIMPLENAME', 'NVARCHAR(500)', 'NOT NULL', '0100', ''' ''';

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_STRUCTOFENT_S') 
 CREATE TABLE T_BCM_STRUCTOFENT_S (
FID BIGINT DEFAULT 0 NOT NULL,
FISOUTERORG CHAR(1) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_NOFINANCIALFILE' AND KSQL_COL_NAME ='FMASTERID') 
 ALTER TABLE T_BCM_NOFINANCIALFILE ADD (FMASTERID BIGINT DEFAULT 0 NOT NULL );
 
 EXEC p_AlterColumn 'T_BCM_ANALYTICSSOLUTIONS', 'FTURNSTATUS', 'VARCHAR(50)', 'NOT NULL', '1111', ''' ''';
 
 EXEC p_AlterColumn 'T_BCM_MODELOLAP_DIMRANGE', 'FDIMENSIONPROPERTY', 'VARCHAR(50)', 'NOT NULL', '1111', ''' ''';



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