/**Begin D:\PDM_UPGRADE\pdm_new\BOS_table.sql **/
 EXEC p_AlterColumn 'T_PERM_LOG_USER', 'FNAME', 'NVARCHAR(255)', 'NOT NULL', '0100', ''' ''';

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PERM_LOG_DIFF_DIMUSRGRP') 
 CREATE TABLE T_PERM_LOG_DIFF_DIMUSRGRP (
FID BIGINT DEFAULT 0 NOT NULL,
FPERM_LOGID BIGINT DEFAULT 0 NOT NULL,
FDIM_ID BIGINT DEFAULT 0 NOT NULL,
FDIM_NUMBER VARCHAR(36) DEFAULT ' ' NOT NULL,
FDIM_NAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FINCLUDE_SUBORG CHAR(1) DEFAULT '0' NOT NULL,
FINCLUDE_SUBORG_DESC NVARCHAR(20) DEFAULT ' ' NOT NULL,
FDIMTYPE VARCHAR(30) DEFAULT ' ' NOT NULL,
FDIMTYPEDESC VARCHAR(30) DEFAULT ' ' NOT NULL,
FUSRGRP_ID BIGINT DEFAULT 0 NOT NULL,
FUSRGRP_NAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FUSRGRP_NUMBER NVARCHAR(80) DEFAULT ' ' NOT NULL,
FSTARTTIME DATETIME,
FENDTIME DATETIME,
FOP_DESC NVARCHAR(300) DEFAULT ' ' NOT NULL,
FCREATE_TIME DATETIME,
FDATACHANGE_TYPE INT DEFAULT 0 NOT NULL,
FDATACHANGE_TYPE_DESC NVARCHAR(20) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PERM_LOG_DIFF_USRGRPU') 
 CREATE TABLE T_PERM_LOG_DIFF_USRGRPU (
FID BIGINT DEFAULT 0 NOT NULL,
FPERM_LOGID BIGINT DEFAULT 0 NOT NULL,
FUSRGRP_ID BIGINT DEFAULT 0 NOT NULL,
FUSRGRP_NAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FUSRGRP_NUMBER NVARCHAR(80) DEFAULT ' ' NOT NULL,
FUSER_ID BIGINT DEFAULT 0 NOT NULL,
FUSER_NAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FUSER_NUMBER VARCHAR(36) DEFAULT ' ' NOT NULL,
FUSER_USERNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FPHONE VARCHAR(36) DEFAULT ' ' NOT NULL,
FEMAIL VARCHAR(100) DEFAULT ' ' NOT NULL,
FFROM_TYPE VARCHAR(1) DEFAULT '0' NOT NULL,
FFROM_TYPE_DESC VARCHAR(50) DEFAULT ' ' NOT NULL,
FOP_DESC NVARCHAR(300) DEFAULT ' ' NOT NULL,
FCREATE_TIME DATETIME,
FDATACHANGE_TYPE INT DEFAULT 0 NOT NULL,
FDATACHANGE_TYPE_DESC NVARCHAR(20) DEFAULT ' ' NOT NULL
);



/**End D:\PDM_UPGRADE\pdm_new\BOS_table.sql **/
