IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PERM_DATARULE' AND KSQL_COL_NAME ='FDESCRIPTION') 
 ALTER TABLE T_PERM_DATARULE ADD (FDESCRIPTION VARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PERM_DATARULE_PROP' AND KSQL_COL_NAME ='FSEQ') 
 ALTER TABLE T_PERM_DATARULE_PROP ADD (FSEQ INT DEFAULT 0 NOT NULL );

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PERM_DATARULE_PROP' AND KSQL_COL_NAME ='FPROPENTNUM') 
 ALTER TABLE T_PERM_DATARULE_PROP ADD (FPROPENTNUM VARCHAR(36) DEFAULT ' ' NOT NULL );
 
 
EXEC p_AlterColumn 'T_PERM_DATARULE', 'FNUMBER', 'NVARCHAR(100)', 'NOT NULL', '0100', ''' ''';

EXEC p_AlterColumn 'T_PERM_DATARULES', 'FNUMBER', 'NVARCHAR(100)', 'NOT NULL', '0100', ''' ''';

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PERM_DATARULE' AND KSQL_COL_NAME ='FRULE_TAG') 
 ALTER TABLE T_PERM_DATARULE ADD (FRULE_TAG NCLOB );