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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_DIMENSIONMAPNEW') 
 CREATE TABLE T_BCM_DIMENSIONMAPNEW (
FID BIGINT DEFAULT 0 NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FDIMENSION BIGINT DEFAULT 0 NOT NULL,
FDIMENSIONMAP BIGINT DEFAULT 0 NOT NULL
);



 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_DIMENSIONMAPNEW') CREATE INDEX IDX_BCM_DIMENSIONMAPNEW ON T_BCM_DIMENSIONMAPNEW ( FMODELID );
 
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_DIMENSIONMAPNEW' AND KSQL_COL_NAME ='FID') 
 
  EXEC p_AlterPK 'PK_T_BCM_DIMENSIONMAPNEW', 'T_BCM_DIMENSIONMAPNEW', 'fid', '1';

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