/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\EB_table.sql **/
 EXEC p_AlterColumn 'T_EB_STRUCTOFBILL', 'FBILLTYPE', 'NVARCHAR(20)', 'NOT NULL', '0100', ''' ''';

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_BGCONTROLOPERLOG') 
 CREATE TABLE T_EB_BGCONTROLOPERLOG (
FID BIGINT DEFAULT 0 NOT NULL,
FENTITYNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL,
FBILLID NVARCHAR(50) DEFAULT ' ' NOT NULL,
FBILLNUMBER NVARCHAR(80) DEFAULT ' ' NOT NULL,
FOPERATION NVARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATEDATE DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_BGCONTROLRECORD' AND KSQL_COL_NAME IN ('FEXTBIZID')) 
 ALTER TABLE T_EB_BGCONTROLRECORD ADD (FEXTBIZID NVARCHAR(44) DEFAULT ' ' NOT NULL );

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