/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\SYS_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_CTS_ADDRESS') 
 CREATE TABLE T_CTS_ADDRESS (
FID BIGINT DEFAULT 0 NOT NULL,
FCONFIGID BIGINT DEFAULT 0 NOT NULL,
FSOURCE NVARCHAR(30) DEFAULT ' ' NOT NULL,
FCOUNTRYID BIGINT DEFAULT 0 NOT NULL,
FADMINDIVISIONID1 BIGINT DEFAULT 0 NOT NULL,
FADMINDIVISIONID2 BIGINT DEFAULT 0 NOT NULL,
FADMINDIVISIONID3 BIGINT DEFAULT 0 NOT NULL,
FADMINDIVISIONID4 BIGINT DEFAULT 0 NOT NULL,
FADMINDIVISIONID5 BIGINT DEFAULT 0 NOT NULL,
FADMINDIVISIONID6 BIGINT DEFAULT 0 NOT NULL,
FSTREET1 NVARCHAR(255) DEFAULT ' ' NOT NULL,
FSTREET2 NVARCHAR(255) DEFAULT ' ' NOT NULL,
FHOUSENUM NVARCHAR(255) DEFAULT ' ' NOT NULL,
FHOUSENUM2 NVARCHAR(255) DEFAULT ' ' NOT NULL,
FBUILDING NVARCHAR(255) DEFAULT ' ' NOT NULL,
FFLOOR NVARCHAR(255) DEFAULT ' ' NOT NULL,
FROOMNUM NVARCHAR(255) DEFAULT ' ' NOT NULL,
FPOSTCODE1 NVARCHAR(10) DEFAULT ' ' NOT NULL,
FPOSTCODE2 NVARCHAR(10) DEFAULT ' ' NOT NULL,
FPOSTCODE3 NVARCHAR(10) DEFAULT ' ' NOT NULL,
FPOSTCODEEXT NVARCHAR(10) DEFAULT ' ' NOT NULL,
FPOBOX NVARCHAR(255) DEFAULT ' ' NOT NULL,
FADDRESS1 NVARCHAR(255) DEFAULT ' ' NOT NULL,
FADDRESS2 NVARCHAR(255) DEFAULT ' ' NOT NULL,
FADDRESS3 NVARCHAR(255) DEFAULT ' ' NOT NULL,
FADDRESS4 NVARCHAR(255) DEFAULT ' ' NOT NULL,
FADDRESS5 NVARCHAR(255) DEFAULT ' ' NOT NULL,
FNUMBER NVARCHAR(1024) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(1024) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_CTS_ADDRESSCONFIG') 
 CREATE TABLE T_CTS_ADDRESSCONFIG (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(30) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FISCONTAINADMIN CHAR(1) DEFAULT ' ' NOT NULL,
FADMINLEVEL SMALLINT DEFAULT 0 NOT NULL,
FISDEFAULT CHAR(1) DEFAULT ' ' NOT NULL,
FENABLE CHAR(1) DEFAULT '1' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME
);



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