/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\EB_table.sql **/
 EXEC p_AlterColumn 'T_EB_UPDATERECORD', 'FVERSION', 'NVARCHAR(30)', 'NOT NULL', '0010', ''' ''';
 
  EXEC p_AlterColumn 'T_EB_DATASOURCE', 'FQUOTE', 'CHAR(1)', 'NOT NULL', '0001', '''0''';

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_STRUCTOFPROCESS' AND KSQL_COL_NAME ='FSTORAGETYPE') 
 ALTER TABLE T_EB_STRUCTOFPROCESS ADD (FSTORAGETYPE CHAR(1) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_STRUCTOFSCENE' AND KSQL_COL_NAME ='FSTORAGETYPE') 
 ALTER TABLE T_EB_STRUCTOFSCENE ADD (FSTORAGETYPE CHAR(1) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_STRUCTOFENT' AND KSQL_COL_NAME ='FSTORAGETYPE') 
 ALTER TABLE T_EB_STRUCTOFENT ADD (FSTORAGETYPE CHAR(1) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_STRUCTOFENT' AND KSQL_COL_NAME ='FCOPYFROM') 
 ALTER TABLE T_EB_STRUCTOFENT ADD (FCOPYFROM BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_STRUCTOFFY' AND KSQL_COL_NAME ='FSTORAGETYPE') 
 ALTER TABLE T_EB_STRUCTOFFY ADD (FSTORAGETYPE CHAR(1) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_STRUCTOFFY' AND KSQL_COL_NAME ='FCOPYFROM') 
 ALTER TABLE T_EB_STRUCTOFFY ADD (FCOPYFROM BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_STRUCTOFPERIOD' AND KSQL_COL_NAME ='FSTORAGETYPE') 
 ALTER TABLE T_EB_STRUCTOFPERIOD ADD (FSTORAGETYPE CHAR(1) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_STRUCTOFPERIOD' AND KSQL_COL_NAME ='FCOPYFROM') 
 ALTER TABLE T_EB_STRUCTOFPERIOD ADD (FCOPYFROM BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_STRUCTOFAUDITTRIAL' AND KSQL_COL_NAME ='FSTORAGETYPE') 
 ALTER TABLE T_EB_STRUCTOFAUDITTRIAL ADD (FSTORAGETYPE CHAR(1) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_STRUCTOFAUDITTRIAL' AND KSQL_COL_NAME ='FCOPYFROM') 
 ALTER TABLE T_EB_STRUCTOFAUDITTRIAL ADD (FCOPYFROM BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_STRUCTOFCURRENCY' AND KSQL_COL_NAME ='FSTORAGETYPE') 
 ALTER TABLE T_EB_STRUCTOFCURRENCY ADD (FSTORAGETYPE CHAR(1) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_STRUCTOFCURRENCY' AND KSQL_COL_NAME ='FCOPYFROM') 
 ALTER TABLE T_EB_STRUCTOFCURRENCY ADD (FCOPYFROM BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_STRUCTOFVERSION' AND KSQL_COL_NAME ='FSTORAGETYPE') 
 ALTER TABLE T_EB_STRUCTOFVERSION ADD (FSTORAGETYPE CHAR(1) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_STRUCTOFVERSION' AND KSQL_COL_NAME ='FCOPYFROM') 
 ALTER TABLE T_EB_STRUCTOFVERSION ADD (FCOPYFROM BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_STRUCTOFDATETYPE' AND KSQL_COL_NAME ='FSTORAGETYPE') 
 ALTER TABLE T_EB_STRUCTOFDATETYPE ADD (FSTORAGETYPE CHAR(1) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_STRUCTOFDATETYPE' AND KSQL_COL_NAME ='FCOPYFROM') 
 ALTER TABLE T_EB_STRUCTOFDATETYPE ADD (FCOPYFROM BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_STRUCTOFICENTITY' AND KSQL_COL_NAME ='FSTORAGETYPE') 
 ALTER TABLE T_EB_STRUCTOFICENTITY ADD (FSTORAGETYPE CHAR(1) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_STRUCTOFICENTITY' AND KSQL_COL_NAME ='FCOPYFROM') 
 ALTER TABLE T_EB_STRUCTOFICENTITY ADD (FCOPYFROM BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_STRUCTOFBPERIOD' AND KSQL_COL_NAME ='FSTORAGETYPE') 
 ALTER TABLE T_EB_STRUCTOFBPERIOD ADD (FSTORAGETYPE CHAR(1) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_STRUCTOFBPERIOD' AND KSQL_COL_NAME ='FCOPYFROM') 
 ALTER TABLE T_EB_STRUCTOFBPERIOD ADD (FCOPYFROM BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_STRUCTOFMETRIC' AND KSQL_COL_NAME ='FSTORAGETYPE') 
 ALTER TABLE T_EB_STRUCTOFMETRIC ADD (FSTORAGETYPE CHAR(1) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_STRUCTOFMETRIC' AND KSQL_COL_NAME ='FCOPYFROM') 
 ALTER TABLE T_EB_STRUCTOFMETRIC ADD (FCOPYFROM BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_STRUCTOFACCOUNT' AND KSQL_COL_NAME ='FDATATYPE') 
 ALTER TABLE T_EB_STRUCTOFACCOUNT ADD (FDATATYPE CHAR(1) DEFAULT '1' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_STRUCTOFACCOUNT' AND KSQL_COL_NAME ='FCOPYFROM') 
 ALTER TABLE T_EB_STRUCTOFACCOUNT ADD (FCOPYFROM BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_STRUCTOFCHANGETYPE' AND KSQL_COL_NAME ='FSTORAGETYPE') 
 ALTER TABLE T_EB_STRUCTOFCHANGETYPE ADD (FSTORAGETYPE CHAR(1) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_STRUCTOFCHANGETYPE' AND KSQL_COL_NAME ='FCOPYFROM') 
 ALTER TABLE T_EB_STRUCTOFCHANGETYPE ADD (FCOPYFROM BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_STRUCTOFDEFINED' AND KSQL_COL_NAME ='FSTORAGETYPE') 
 ALTER TABLE T_EB_STRUCTOFDEFINED ADD (FSTORAGETYPE CHAR(1) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_STRUCTOFDEFINED' AND KSQL_COL_NAME ='FCOPYFROM') 
 ALTER TABLE T_EB_STRUCTOFDEFINED ADD (FCOPYFROM BIGINT DEFAULT 0 NOT NULL );
 
 



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