/**Begin  **/

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_SPLITNEWROW') 
 CREATE TABLE T_EB_SPLITNEWROW (
FID BIGINT DEFAULT 0 NOT NULL,
FSPLITBILLID BIGINT DEFAULT 0 NOT NULL,
FPRESPLITROWID BIGINT DEFAULT 0 NOT NULL,
FREFFIRSTSPLITROWID BIGINT DEFAULT 0 NOT NULL,
FTEMPLATENUMBER NVARCHAR(100) DEFAULT ' ' NOT NULL
);

EXEC P_ALTERPK 'pk_eb_splitnewrow', 'T_EB_SPLITNEWROW', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'idx_eb_splitnewrow_bill') CREATE INDEX idx_eb_splitnewrow_bill ON T_EB_SPLITNEWROW (FSPLITBILLID ASC);

/**End **/