/**Begin D:\PDM_UPGRADE\PDM1\EB_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_MEMBERMAPPING' AND KSQL_COL_NAME ='FWILDCARDSTATUS') 
 ALTER TABLE T_EB_MEMBERMAPPING ADD (FWILDCARDSTATUS CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_RPTSCHEME' AND KSQL_COL_NAME ='FAPPLYSCOPE') 
 ALTER TABLE T_EB_RPTSCHEME ADD (FAPPLYSCOPE CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_SCHEMEASSIGN' AND KSQL_COL_NAME ='FAPPLYSCOPE') 
 ALTER TABLE T_EB_SCHEMEASSIGN ADD (FAPPLYSCOPE CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_TEMPLATEORG' AND KSQL_COL_NAME ='FAPPLYTEMPLATEID') 
 ALTER TABLE T_EB_TEMPLATEORG ADD (FAPPLYTEMPLATEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_TEMPLATEORG' AND KSQL_COL_NAME ='FTEMPLATETYPE') 
 ALTER TABLE T_EB_TEMPLATEORG ADD (FTEMPLATETYPE CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_TEMPLATEUSER' AND KSQL_COL_NAME ='FAPPLYTEMPLATEID') 
 ALTER TABLE T_EB_TEMPLATEUSER ADD (FAPPLYTEMPLATEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_TEMPLATEUSER' AND KSQL_COL_NAME ='FTEMPLATETYPE') 
 ALTER TABLE T_EB_TEMPLATEUSER ADD (FTEMPLATETYPE CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_APTEMPLATEFORMAT') 
 CREATE TABLE T_EB_APTEMPLATEFORMAT (
FID BIGINT DEFAULT 0 NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FAPPLYTEMPLATEID BIGINT DEFAULT 0 NOT NULL,
FUSERID BIGINT DEFAULT 0 NOT NULL,
FTEXTFIELD NVARCHAR(50) DEFAULT ' ' NOT NULL,
FCOLUMNKEY NVARCHAR(50) DEFAULT ' ' NOT NULL,
FISHIDE CHAR(1) DEFAULT '0' NOT NULL,
FISFREEZE CHAR(1) DEFAULT '0' NOT NULL
);



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