IF NOT EXISTS ( SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MSPLAN_GTTCUSTOM' )
 CREATE TABLE T_MSPLAN_GTTCUSTOM(
   FID            BIGINT         DEFAULT 0   NOT NULL,
   FTASKENTITYID  NVARCHAR(255)  DEFAULT ' ' NOT NULL,
   FDATAID        BIGINT         DEFAULT 0   NOT NULL
);


IF NOT EXISTS ( SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MSPLAN_GTTCUSENTITY' )
 CREATE TABLE T_MSPLAN_GTTCUSENTITY(
  FENTRYID       BIGINT         DEFAULT 0   NOT NULL,
  FID            BIGINT         DEFAULT 0   NOT NULL,
  FSEQ           INT            DEFAULT 0   NOT NULL,
  FCROSSOBJ      NVARCHAR(50)   DEFAULT ' ' NOT NULL,
  FCROSSTYPEID   BIGINT         DEFAULT 0   NOT NULL
);



IF NOT EXISTS ( SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MSPLAN_GTTCUSSUB' )
 CREATE TABLE T_MSPLAN_GTTCUSSUB(
  FDETAILID         BIGINT         DEFAULT 0   NOT NULL,
  FENTRYID          BIGINT         DEFAULT 0   NOT NULL,
  FSEQ              INT            DEFAULT 0   NOT NULL,
  FCONTENTLOCATION  NVARCHAR(50)   DEFAULT ' ' NOT NULL,
  FCONTENTTYPE      NVARCHAR(50)   DEFAULT ' ' NOT NULL,
  FCONCATFLAG       NVARCHAR(50)   DEFAULT ' ' NOT NULL,
  FFIELDCONTENT     NVARCHAR(2000) DEFAULT ' ' NOT NULL,
  FFIELDCONTENTDESC NVARCHAR(2000) DEFAULT ' ' NOT NULL,
  FCONTENTNOTE      NVARCHAR(1000) DEFAULT ' ' NOT NULL,
  FLBLFORMAT        NVARCHAR(50)   DEFAULT ' ' NOT NULL,
  FLBLTYPE          NVARCHAR(50)   DEFAULT ' ' NOT NULL,
  FCUSTOMIMPL       BIGINT         DEFAULT 0   NOT NULL
);