/*用车申请单项目干系人*/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_ER_DAILYVEHICLEOWER')
CREATE TABLE T_ER_DAILYVEHICLEOWER (
                                       FPKID BIGINT DEFAULT 0 NOT NULL,
                                       FID BIGINT DEFAULT 0 NOT NULL,
                                       FBASEDATAID BIGINT DEFAULT 0 NOT NULL
);

EXEC P_ALTERPK 'PK_ER_DAILYVEHICLEOWER', 'T_ER_DAILYVEHICLEOWER', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_ER_DAILYVEHICLEOWER' AND KSQL_INDNAME = 'IDX_ER_DAILYVEHICLEOWER_FID') CREATE INDEX IDX_ER_DAILYVEHICLEOWER_FID ON T_ER_DAILYVEHICLEOWER ( FID );




