/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\FA_table.sql **/
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FA_ASSETSPLITENTRY_D' AND KSQL_COL_NAME IN ('FASSETNAME'))
 ALTER TABLE T_FA_ASSETSPLITENTRY_D ADD (FASSETNAME NVARCHAR(300));

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FA_ASSETSPLITENTRY_D_L')
 CREATE TABLE T_FA_ASSETSPLITENTRY_D_L (
FPKID VARCHAR(18) DEFAULT ' ' NOT NULL,
FDETAILID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FASSETNAME NVARCHAR(300) DEFAULT ' ' NOT NULL
);

 EXEC P_ALTERPK 'PK_FA_ASSETSPLITENTRY_D_L', 'T_FA_ASSETSPLITENTRY_D_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FA_ASSETSPLITENTRY_D_L') CREATE INDEX IDX_FA_ASSETSPLITENTRY_D_L ON T_FA_ASSETSPLITENTRY_D_L ( FDETAILID ,FLOCALEID );

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