/**Begin C:\PDM_UPGRADE\PDM1\SRM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRM_COMPENTBASE') 
 CREATE TABLE T_SRM_COMPENTBASE (
FID BIGINT DEFAULT 0 NOT NULL,
FPARENTID VARCHAR(100) DEFAULT ' ' NOT NULL,
FENTITYKEY VARCHAR(100) DEFAULT ' ' NOT NULL,
FPENTITYKEY VARCHAR(100) DEFAULT ' ' NOT NULL,
FMAINORGID BIGINT DEFAULT 0 NOT NULL,
FPROJECTID BIGINT DEFAULT 0 NOT NULL,
FDATACHANNEL NVARCHAR(255) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FADDRESS NVARCHAR(255) DEFAULT ' ' NOT NULL,
FREGDATE DATETIME,
FREGCAPITAL DECIMAL(23,10) DEFAULT 0 NOT NULL,
FTYPE VARCHAR(10) DEFAULT ' ' NOT NULL,
FARTIFICIALPERSON NVARCHAR(255) DEFAULT ' ' NOT NULL,
FSOCIETYCREDITCODE NVARCHAR(255) DEFAULT ' ' NOT NULL,
FTXREGISTERNO NVARCHAR(255) DEFAULT ' ' NOT NULL,
FTAXCLASS VARCHAR(10) DEFAULT ' ' NOT NULL,
FINVOICETYPEID BIGINT DEFAULT 0 NOT NULL,
FTAXRATEID BIGINT DEFAULT 0 NOT NULL,
FTELEPHONE VARCHAR(100) DEFAULT ' ' NOT NULL,
FURL NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRM_COMPENTBASE_L') 
 CREATE TABLE T_SRM_COMPENTBASE_L (
FPKID VARCHAR(40) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FADDRESS NVARCHAR(255) DEFAULT ' ' NOT NULL,
FARTIFICIALPERSON NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRM_COMPBASEBANK') 
 CREATE TABLE T_SRM_COMPBASEBANK (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FACCOUNT NVARCHAR(100) DEFAULT ' ' NOT NULL,
FACCOUNTNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FBANKID BIGINT DEFAULT 0 NOT NULL,
FACCCURRID BIGINT DEFAULT 0 NOT NULL,
FISDEFAULT CHAR(1) DEFAULT '0' NOT NULL,
FACCOUNTTYPE VARCHAR(10) DEFAULT ' ' NOT NULL,
FBANKNOTE NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRM_COMPBASELINK') 
 CREATE TABLE T_SRM_COMPBASELINK (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FLINKNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FMOBILE VARCHAR(50) DEFAULT ' ' NOT NULL,
FEMAIL NVARCHAR(100) DEFAULT ' ' NOT NULL,
FISDEFAULT_LINK CHAR(1) DEFAULT '0' NOT NULL,
FGENDER VARCHAR(5) DEFAULT ' ' NOT NULL,
FDEPT NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDUTY NVARCHAR(100) DEFAULT ' ' NOT NULL,
FBIZSCOPETYPE VARCHAR(5) DEFAULT ' ' NOT NULL,
FPHONE VARCHAR(50) DEFAULT ' ' NOT NULL,
FBIZSCOPE NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRM_COMPENTDEVELOP') 
 CREATE TABLE T_SRM_COMPENTDEVELOP (
FID BIGINT DEFAULT 0 NOT NULL,
FPARENTID VARCHAR(100) DEFAULT ' ' NOT NULL,
FPENTITYKEY VARCHAR(100) DEFAULT ' ' NOT NULL,
FMAINORGID BIGINT DEFAULT 0 NOT NULL,
FPROJECTID BIGINT DEFAULT 0 NOT NULL,
FENTITYKEY VARCHAR(100) DEFAULT ' ' NOT NULL,
FCLASSICCASE NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRM_COMPDEVELOPENTRY') 
 CREATE TABLE T_SRM_COMPDEVELOPENTRY (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FORGANIZATION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FUSED NVARCHAR(255) DEFAULT ' ' NOT NULL,
FVALIDDATETO DATETIME,
FSPECIAL NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRM_COMPENTCUSTOMER') 
 CREATE TABLE T_SRM_COMPENTCUSTOMER (
FID BIGINT DEFAULT 0 NOT NULL,
FPARENTID VARCHAR(100) DEFAULT ' ' NOT NULL,
FPENTITYKEY VARCHAR(100) DEFAULT ' ' NOT NULL,
FMAINORGID BIGINT DEFAULT 0 NOT NULL,
FPROJECTID BIGINT DEFAULT 0 NOT NULL,
FENTITYKEY VARCHAR(100) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRM_COMPCUSTOMERENTRY') 
 CREATE TABLE T_SRM_COMPCUSTOMERENTRY (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FFIELD NVARCHAR(255) DEFAULT ' ' NOT NULL,
FPROJECTNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FADDRESS NVARCHAR(255) DEFAULT ' ' NOT NULL,
FPRODUCT NVARCHAR(255) DEFAULT ' ' NOT NULL,
FCONTRACTAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FDATABEGAIN DATETIME,
FDATEEND DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRM_COMPENTQOS') 
 CREATE TABLE T_SRM_COMPENTQOS (
FID BIGINT DEFAULT 0 NOT NULL,
FPARENTID VARCHAR(100) DEFAULT ' ' NOT NULL,
FPENTITYKEY VARCHAR(100) DEFAULT ' ' NOT NULL,
FMAINORGID BIGINT DEFAULT 0 NOT NULL,
FPROJECTID BIGINT DEFAULT 0 NOT NULL,
FENTITYKEY VARCHAR(100) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRM_COMPQOSAPTITUDE') 
 CREATE TABLE T_SRM_COMPQOSAPTITUDE (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FCOMPANYTYPEID BIGINT DEFAULT 0 NOT NULL,
FAPTITUDETYPEID BIGINT DEFAULT 0 NOT NULL,
FREQUIRED CHAR(1) DEFAULT '0' NOT NULL,
FAPTITUDENAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FISSUEORG NVARCHAR(255) DEFAULT ' ' NOT NULL,
FAPTITUDENUMBER NVARCHAR(100) DEFAULT ' ' NOT NULL,
FGRADE NVARCHAR(100) DEFAULT ' ' NOT NULL,
FISSUEDATE DATETIME,
FDATETO DATETIME,
FCHECKDATE DATETIME,
FNOTE NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRM_COMPQOSAPTITUDE_FJ') 
 CREATE TABLE T_SRM_COMPQOSAPTITUDE_FJ (
FPKID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FBASEDATAID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRM_COMPINSPECT') 
 CREATE TABLE T_SRM_COMPINSPECT (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FEQUIPMENTNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FINSPECTPROJECT NVARCHAR(255) DEFAULT ' ' NOT NULL,
FACCURACY NVARCHAR(100) DEFAULT ' ' NOT NULL,
FPROJECTNUM BIGINT DEFAULT 0 NOT NULL,
FBUYDATE DATETIME,
FINSPECTDATE DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRM_COMPENTSCALE') 
 CREATE TABLE T_SRM_COMPENTSCALE (
FID BIGINT DEFAULT 0 NOT NULL,
FPARENTID VARCHAR(100) DEFAULT ' ' NOT NULL,
FPENTITYKEY VARCHAR(100) DEFAULT ' ' NOT NULL,
FMAINORGID BIGINT DEFAULT 0 NOT NULL,
FPROJECTID BIGINT DEFAULT 0 NOT NULL,
FENTITYKEY VARCHAR(100) DEFAULT ' ' NOT NULL,
FSTAFFNUM BIGINT DEFAULT 0 NOT NULL,
FMANAGEMENTSTAFF BIGINT DEFAULT 0 NOT NULL,
FTECHNICIANNUM BIGINT DEFAULT 0 NOT NULL,
FTWOYEARLATER BIGINT DEFAULT 0 NOT NULL,
FPLANTAREA BIGINT DEFAULT 0 NOT NULL,
FWAREHOUSEAREA BIGINT DEFAULT 0 NOT NULL,
FOFFICEAREA BIGINT DEFAULT 0 NOT NULL,
FANNUALSALES BIGINT DEFAULT 0 NOT NULL,
FQUALITYSTAFFNUM BIGINT DEFAULT 0 NOT NULL,
FTWOYEARLATERQUO BIGINT DEFAULT 0 NOT NULL,
FSELFCHECKPEO BIGINT DEFAULT 0 NOT NULL,
FIQPCPEO BIGINT DEFAULT 0 NOT NULL,
FFINSHPROPEO BIGINT DEFAULT 0 NOT NULL,
FTOTALPEOPLE BIGINT DEFAULT 0 NOT NULL,
FRDPEOPLENUM BIGINT DEFAULT 0 NOT NULL,
FENGINEERNUM BIGINT DEFAULT 0 NOT NULL,
FRDABILITY VARCHAR(10) DEFAULT ' ' NOT NULL,
FISOUT VARCHAR(10) DEFAULT ' ' NOT NULL,
FPRODUCTDAY BIGINT DEFAULT 0 NOT NULL,
FOUTPRODUCTDAY BIGINT DEFAULT 0 NOT NULL,
FTRANSPORTDAY BIGINT DEFAULT 0 NOT NULL,
FPRODUCTSAMPLE BIGINT DEFAULT 0 NOT NULL,
FISLOW VARCHAR(10) DEFAULT ' ' NOT NULL,
FLOWNUM BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRM_ENTRYGOODS') 
 CREATE TABLE T_SRM_ENTRYGOODS (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FPRODUCT NVARCHAR(255) DEFAULT ' ' NOT NULL,
FGOODSNUMBER NVARCHAR(100) DEFAULT ' ' NOT NULL,
FGOODSNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FGOODSMODEL NVARCHAR(100) DEFAULT ' ' NOT NULL,
FGOODSDESC NVARCHAR(255) DEFAULT ' ' NOT NULL,
FMONTHLYCAPACITY NVARCHAR(100) DEFAULT ' ' NOT NULL,
FCAPACITYUSE NVARCHAR(100) DEFAULT ' ' NOT NULL,
FYEARCAPACITY NVARCHAR(100) DEFAULT ' ' NOT NULL,
FGOODSNOTE NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRM_COMPARTNERENTRY') 
 CREATE TABLE T_SRM_COMPARTNERENTRY (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FPARTNERNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FPARTNERGOODS NVARCHAR(100) DEFAULT ' ' NOT NULL,
FPARTNERADDRESS NVARCHAR(100) DEFAULT ' ' NOT NULL,
FPARTNERLINK NVARCHAR(100) DEFAULT ' ' NOT NULL,
FPARTNERPHO VARCHAR(100) DEFAULT ' ' NOT NULL,
FPARTNERDATE NVARCHAR(100) DEFAULT ' ' NOT NULL,
FRELATION VARCHAR(10) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRM_COMPRODUCTENTRY') 
 CREATE TABLE T_SRM_COMPRODUCTENTRY (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FPRODUCTOOLNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FPRODUCTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FPRODUCTOOLNUM BIGINT DEFAULT 0 NOT NULL,
FABILITY NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDATE DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRM_COMMAINPRODUCT') 
 CREATE TABLE T_SRM_COMMAINPRODUCT (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FMAIPRODUCTNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FMAIPRODUCTSUP NVARCHAR(255) DEFAULT ' ' NOT NULL,
FMAINNOTE NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRM_QUESTIONCOMP') 
 CREATE TABLE T_SRM_QUESTIONCOMP (
FID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FBILLNO VARCHAR(80) DEFAULT ' ' NOT NULL,
FQUESTIONBILLNO VARCHAR(80) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FTEMPLATEID BIGINT DEFAULT 0 NOT NULL,
FBILLSTATUS VARCHAR(5) DEFAULT ' ' NOT NULL,
FRELEASEDATE DATETIME,
FSUPPLIERID BIGINT DEFAULT 0 NOT NULL,
FLOCKSTATUS VARCHAR(5) DEFAULT ' ' NOT NULL,
FBIZPARTNERID BIGINT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FLASTUPDATEUSERID BIGINT DEFAULT 0 NOT NULL,
FLASTUPDATETIME DATETIME,
FAUDITORID BIGINT DEFAULT 0 NOT NULL,
FAUDITDATE DATETIME,
FSRCSUPQUESTIONID VARCHAR(50) DEFAULT ' ' NOT NULL,
FPARENTID VARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRM_SUPQUESTIONNAIRE') 
 CREATE TABLE T_SRM_SUPQUESTIONNAIRE (
FID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FBILLNO VARCHAR(80) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FRELEASEDATE DATETIME,
FBILLSTATUS VARCHAR(5) DEFAULT ' ' NOT NULL,
FLOCKSTATUS VARCHAR(5) DEFAULT ' ' NOT NULL,
FNOTE NVARCHAR(255) DEFAULT ' ' NOT NULL,
FALLSUPISSUB CHAR(1) DEFAULT '0' NOT NULL,
FTPLCONFIGID BIGINT DEFAULT 0 NOT NULL,
FAUDITDATE DATETIME,
FCREATETIME DATETIME,
FAUDITORID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRM_QUESTIONCOMP_L') 
 CREATE TABLE T_SRM_QUESTIONCOMP_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRM_SUPQUESTIONNAIRE_L') 
 CREATE TABLE T_SRM_SUPQUESTIONNAIRE_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRM_QUESTIONENTRY') 
 CREATE TABLE T_SRM_QUESTIONENTRY (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FSUPPLIERID BIGINT DEFAULT 0 NOT NULL,
FSUPUSERID BIGINT DEFAULT 0 NOT NULL,
FSUPDATETIME DATETIME,
FSUPDEALSTATUS VARCHAR(5) DEFAULT ' ' NOT NULL,
FENTRYLOCK VARCHAR(5) DEFAULT ' ' NOT NULL,
FMODIFIERFIELD BIGINT DEFAULT 0 NOT NULL,
FMODIFYDATEFIELD DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRM_SUPQUESTIONATT') 
 CREATE TABLE T_SRM_SUPQUESTIONATT (
FPKID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FBASEDATAID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRM_QUESTIONRANGE') 
 CREATE TABLE T_SRM_QUESTIONRANGE (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(80) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FSTATUS VARCHAR(5) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FENABLE VARCHAR(5) DEFAULT ' ' NOT NULL,
FNOTE NVARCHAR(255) DEFAULT ' ' NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRM_QUESTIONRANGE_L') 
 CREATE TABLE T_SRM_QUESTIONRANGE_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRM_TPLRANGE') 
 CREATE TABLE T_SRM_TPLRANGE (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FQUESTIONTPLID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRM_QUESTIONTPLSUPGROUP') 
 CREATE TABLE T_SRM_QUESTIONTPLSUPGROUP (
FPKID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FBASEDATAID BIGINT DEFAULT 0 NOT NULL
);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRM_QUESTIONSUPGROUP') 
 CREATE TABLE T_SRM_QUESTIONSUPGROUP (
FPKID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FBASEDATAID BIGINT DEFAULT 0 NOT NULL
);

/**End C:\PDM_UPGRADE\PDM1\SRM_table.sql **/
