/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\SBD_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SBD_TRANSCEIVERTYPE') 
 CREATE TABLE T_SBD_TRANSCEIVERTYPE (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(80) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FENABLE CHAR(1) DEFAULT '1' NOT NULL,
FTRANSCEIVER CHAR(1) DEFAULT ' ' NOT NULL,
FBIZDIRECTION CHAR(1) DEFAULT ' ' NOT NULL,
FFORWARDTYPE BIGINT DEFAULT 0 NOT NULL,
FISPRESET CHAR(1) DEFAULT ' ' NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_BIZTYPE' AND KSQL_COL_NAME IN ('FDOMAIN')) 
 ALTER TABLE T_BD_BIZTYPE ADD (FDOMAIN CHAR(1) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_INVTYPE' AND KSQL_COL_NAME IN ('FISFORWARDAMOUNT')) 
 ALTER TABLE T_BD_INVTYPE ADD (FISFORWARDAMOUNT CHAR(1) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SBD_BIZTYPEBILLENTITY') 
 CREATE TABLE T_SBD_BIZTYPEBILLENTITY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FBILLFORM NVARCHAR(36) DEFAULT ' ' NOT NULL
);



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