* SET_DB_M.TXT HARASAWA (MSSQL)
=IF{_DB!='M'}JUMP{M_SKIP};
=LOGIN_SQL{EXEC SP_CONFIGURE 'SHOW ADVANCED OPTIONS','1'};
=LOGIN_SQL{RECONFIGURE WITH OVERRIDE};
=LOGIN_SQL{EXEC SP_CONFIGURE 'REMOTE LOGIN TIMEOUT',60};
=LOGIN_SQL{EXEC SP_CONFIGURE 'REMOTE QUERY TIMEOUT',0};
=LOGIN_SQL{RECONFIGURE WITH OVERRIDE};
***********************( CREATE DATABASE & DUMPDEVICE )*******************
*(PERMISSION_BEGIN)*
=IF{_DB!='M'}JUMP{M_SKIP};
REPEAT0=$W0.PERMISSION
REPEAT=4 (WC.DDAT##,WC.DLOG##,WC.BDAT##,WC.BLOG##)
=MESSAGE{CREATE DATABASE (?WC.PER$$?)}; 
=SET{WC.DB='?WC.IS??WC.##?_?WC.PER$$?'};
=IF_ERROR_LOGIN_SQL{CREATE DATABASE ?WC.DB? ON PRIMARY(
=NAME=DAT
=,FILENAME='?WC.DDAT##??_P??WC.DB?_DAT.MDF'
=,FILEGROWTH=1) LOG ON(NAME=LOG
=,FILENAME='?WC.DLOG##??_P??WC.DB?_LOG.LDF'
=,FILEGROWTH=1)}IF{_DB_I_ERROR!='EXIST'}ERROR{};
=IF_ERROR_LOGIN_SQL{EXEC SP_ADDUMPDEVICE 'DISK','?WC.DB?_DAT'
=,'?WC.BDAT##??_P??WC.DB?.DAT'}
=  IF{_DB_I_ERROR!='EXIST'}ERROR{?_DB_ERROR? ?_ERROR?};
2-4-=IF_ERROR_LOGIN_SQL{EXEC SP_ADDUMPDEVICE 'DISK'
2-4-= ,'?WC.DB?_LOG','?WC.BLOG##??_P??WC.DB?.LOG'}
2-4-=  IF{_DB_I_ERROR!='EXIST'}ERROR{};
=IF{_DB_SOFT/'M200'}JUMP{OLD};
=SET{WC.EX_DB='ALTER DATABASE ?WC.DB? SET'};
=LOGIN_SQL{?WC.EX_DB? AUTO_CLOSE OFF};
=LOGIN_SQL{?WC.EX_DB? AUTO_SHRINK ON};
2-4-=LOGIN_SQL{?WC.EX_DB? RECOVERY FULL};
1-3-=LOGIN_SQL{?WC.EX_DB? RECOVERY SIMPLE};
*2-4-=LOGIN_SQL{?WC.EX_DB?,'SELECT INTO/BULKCOPY','FALSE'};
*1-3-=LOGIN_SQL{?WC.EX_DB?,'SELECT INTO/BULKCOPY','TRUE'};
=JUMP{SKIP};
=OLD:
=SET{WC.EX_DB='EXEC SP_DBOPTION ''?WC.DB?'''};
=LOGIN_SQL{?WC.EX_DB?,'AUTOCLOSE','FALSE'};
=LOGIN_SQL{?WC.EX_DB?,'AUTOSHRINK','TRUE'};
2-4-=LOGIN_SQL{?WC.EX_DB?,'TRUNC. LOG ON CHKPT.','FALSE'};
1-3-=LOGIN_SQL{?WC.EX_DB?,'TRUNC. LOG ON CHKPT.','TRUE'};
2-4-=LOGIN_SQL{?WC.EX_DB?,'SELECT INTO/BULKCOPY','FALSE'};
1-3-=LOGIN_SQL{?WC.EX_DB?,'SELECT INTO/BULKCOPY','TRUE'};
=SKIP:
REPEAT0=
***********************( EXEC SP_ADDLOGIN )******************
REPEAT0=$W0.PERMISSION
REPEAT=2 (WC.R_T##)
***=SET{WC.PAS=WC.PASSWORD_?WC.REAL_TEST##?};
=SET{WC.LTR=WC.REAL_TEST##};
=SET{W0.REPEAT2CNT=0};
REPEAT2=4 (WC.DIOL--)
=COMPUTE{W0.REPEAT2CNT+=1};
=MESSAGE{EXEC SP_ADDLOGIN (?WC.REAL_TEST##?,?WC.PER$$?)}; 
=SET{WC.DIOL=WC.DIOL?W0.REPEAT2CNT?};
=SET{WC.USER=''};
***=IF{W0.REPEAT2CNT=4}SET{WC.PAS=WC.PASSWORD_LINK};
=IF{W0.REPEAT2CNT=4}SET{WC.LTR='LINK'};
***=IF_ERROR_LOGIN_SQL{EXEC SP_ADDLOGIN
***=          '?WC.IS??WC.R_T##?_?WC.DIOL?_?WC.PER$$?'
***=,'?WC.PAS?','?WC.IS??WC.R_T##?_M_?WC.PER$$?'}
=IF_ERROR_LOGIN_ZZ_ADDLOGIN{?WC.LTR?}
=          {?WC.IS??WC.R_T##?_?WC.DIOL?_?WC.PER$$?}
=          {?WC.IS??WC.R_T##?_M_?WC.PER$$?}
=  IF{_DB_I_ERROR!='EXIST'}ERROR{};
REPEAT0=
******************( CREATE USER )****************************
REPEAT0=$W0.PERMISSION
REPEAT=3 (WC.RTT##;WC.RRT##)
=SET{W0.REPEAT2CNT=0};
REPEAT2=$W0.PERMISSION   (WC.PER(ALL)) 
=COMPUTE{W0.REPEAT2CNT+=1};
=SET{WC.PER_ALL=WC.PER?W0.REPEAT2CNT?};
=MESSAGE{EXEC CREATE USER (?WC.PER$$?)}; 
=IF_ERROR_LOGIN_SQL{USE ?WC.IS??WC.RTT##?_M_?WC.PER_ALL?
=  CREATE USER ?WC.IS??WC.RRT##?_D_?WC.PER$$?
=  WITH DEFAULT_SCHEMA=DBO}
=  IF{_DB_I_ERROR!='EXIST'}ERROR{};
=IF_ERROR_LOGIN_SQL{USE ?WC.IS??WC.RTT##?_W_?WC.PER_ALL?
=  CREATE USER ?WC.IS??WC.RRT##?_D_?WC.PER$$?
=  WITH DEFAULT_SCHEMA=DBO}
=  IF{_DB_I_ERROR!='EXIST'}ERROR{};
=IF_ERROR_LOGIN_SQL{USE ?WC.IS??WC.RTT##?_M_?WC.PER_ALL?
=  CREATE USER ?WC.IS??WC.RRT##?_I_?WC.PER$$?
=  WITH DEFAULT_SCHEMA=DBO}
=  IF{_DB_I_ERROR!='EXIST'}ERROR{};
=IF_ERROR_LOGIN_SQL{USE ?WC.IS??WC.RTT##?_W_?WC.PER_ALL?
=  CREATE USER ?WC.IS??WC.RRT##?_I_?WC.PER$$?
=  WITH DEFAULT_SCHEMA=DBO}
=  IF{_DB_I_ERROR!='EXIST'}ERROR{};
=IF_ERROR_LOGIN_SQL{USE ?WC.IS??WC.RTT##?_M_?WC.PER_ALL?
=  CREATE USER ?WC.IS??WC.RRT##?_O_?WC.PER$$?
=  WITH DEFAULT_SCHEMA=DBO}
=  IF{_DB_I_ERROR!='EXIST'}ERROR{};
=IF_ERROR_LOGIN_SQL{USE ?WC.IS??WC.RTT##?_W_?WC.PER_ALL?
=  CREATE USER ?WC.IS??WC.RRT##?_O_?WC.PER$$?
=  WITH DEFAULT_SCHEMA=DBO}
=  IF{_DB_I_ERROR!='EXIST'}ERROR{};
=IF_ERROR_LOGIN_SQL{USE ?WC.IS??WC.RTT##?_M_?WC.PER_ALL?
=  CREATE USER ?WC.IS??WC.RRT##?_L_?WC.PER$$?
=  WITH DEFAULT_SCHEMA=DBO}
=  IF{_DB_I_ERROR!='EXIST'}ERROR{};
=IF_ERROR_LOGIN_SQL{USE ?WC.IS??WC.RTT##?_W_?WC.PER_ALL?
=  CREATE USER ?WC.IS??WC.RRT##?_L_?WC.PER$$?
=  WITH DEFAULT_SCHEMA=DBO}
=  IF{_DB_I_ERROR!='EXIST'}ERROR{};
REPEAT0=
*****************( SP_ADDROLEMEMBER )************************
REPEAT0=$W0.PERMISSION
=MESSAGE{EXEC EXEC SP_ADDROLEMEMBER (?WC.PER$$?)}; 
REPEAT=3 (WC.RTT##;WC.RRT##)
=SET{WC.PERX='ZZZZ'};
=SET{W0.REPEAT2CNT=0};
REPEAT2=2 (WC.PER--;(ZZZZ;自分))
=COMPUTE{W0.REPEAT2CNT+=1}; 
=IF{W0.REPEAT2CNT=2}SET{WC.PERX=WC.PER$$};
=LOGIN_SQL{USE ?WC.IS??WC.RTT##?_M_?WC.PER$$? 
= EXEC SP_ADDROLEMEMBER 'DB_OWNER'
= ,'?WC.IS?R_D_ZZZZ'};
=LOGIN_SQL{USE ?WC.IS??WC.RTT##?_M_?WC.PER$$? 
= EXEC SP_ADDROLEMEMBER 'DB_OWNER'
= ,'?WC.IS??WC.RRT##?_D_?WC.PERX?'};
=LOGIN_SQL{USE ?WC.IS??WC.RTT##?_W_?WC.PER$$?
= EXEC SP_ADDROLEMEMBER 'DB_OWNER'
= ,'?WC.IS??WC.RRT##?_D_?WC.PERX?'};
=LOGIN_SQL{USE ?WC.IS??WC.RTT##?_W_?WC.PER$$?
= EXEC SP_ADDROLEMEMBER 'DB_OWNER'
= ,'?WC.IS??WC.RRT##?_I_?WC.PERX?'};
=LOGIN_SQL{USE ?WC.IS??WC.RTT##?_W_?WC.PER$$?
= EXEC SP_ADDROLEMEMBER 'DB_OWNER'
= ,'?WC.IS??WC.RRT##?_O_?WC.PERX?'};
=IF{WC.PER$$='ZZZZ'}JUMP{SKIP};
REPEAT2=
=SKIP:
REPEAT0=
=JUMP{M_SKIP};
*********( CREATE VIEW )***********************************
*****( OBJECT_VIEW )***************************************
NAME=M_OBJECT_VIEW
=SET{WC.I=WC.INSERT+'''M'','};
COPY=ADD10
=SQL{?WC?'(SYSTEM_KIND,SYSTEM_REAL,SYSTEM_WORK')};
COPY=ADD10
=SQL{?WC?',SYSTEM_USER_X,SYSTEM_NAME,SYSTEM_TEXT')};
COPY=ADD10
=SQL{?WC?',SYSTEM_ADD_DATE17,SYSTEM_CHANGE_DATE17)')};
COPY=ADD10
=SQL{?WC?' AS SELECT CAST(CASE O.TYPE WHEN ''U''')};
COPY=ADD10
=SQL{?WC?' THEN ''TABLE'' WHEN ''V'' THEN ''VIEW''')};
COPY=ADD10
=SQL{?WC?' WHEN ''P'' THEN ''PROC''')};
COPY=ADD10
=SQL{?WC?' WHEN ''FN'' THEN ''FUNC''')};
COPY=ADD10
=SQL{?WC?' WHEN ''TR'' THEN ''TRIG'' ELSE ''XXXXX'' END')};
COPY=ADD10
=SQL{?WC?' AS CHAR(5))')};
COPY=ADD10
=SQL{?WC?',CAST(''?_Q?_REAL_TEST?_Q?'' AS CHAR(4))')};
COPY=ADD10
=SQL{?WC?',CAST(''?WC.MAST_WORK?'' AS CHAR(4))')};
COPY=ADD10
=SQL{?WC?',CAST('' '' AS CHAR(1))')};
COPY=ADD10
=SQL{?WC?',CAST(O.NAME AS NCHAR(30))')};
COPY=ADD10
=SQL{?WC?',C.DEFINITION,CAST(REPLACE(REPLACE(')};
COPY=ADD10
=SQL{?WC?' REPLACE(REPLACE(CONVERT(CHAR(23)')};
COPY=ADD10
=SQL{?WC?',O.CREATE_DATE,121),''-''')};
COPY=ADD10
=SQL{?WC?',''''),'':'',''''),''.'',''''),'' '','''')')};
COPY=ADD10
=SQL{?WC?' AS CHAR(17))')};
COPY=ADD10
=SQL{?WC?',CAST(REPLACE(REPLACE(REPLACE(REPLACE(')};
COPY=ADD10
=SQL{?WC?' CONVERT(CHAR(23),O.MODIFY_DATE,121),''-''')};
COPY=ADD10
=SQL{?WC?',''''),'':'',''''),''.'',''''),'' '','''')')};
COPY=ADD10
=SQL{?WC?' AS CHAR(17)) FROM')};
COPY=ADD10
=SQL{?WC?' ?WC.M_DB?.SYS.SCHEMAS S,')};
COPY=ADD10
=SQL{?WC?' ?WC.M_DB?.SYS.OBJECTS O')};
COPY=ADD10
=SQL{?WC?' LEFT JOIN')};
COPY=ADD10
=SQL{?WC?' ?WC.M_DB?.SYS.SQL_MODULES C ')};
COPY=ADD10
=SQL{?WC?' ON C.OBJECT_ID=O.OBJECT_ID ')};
COPY=ADD10
=SQL{?WC?' WHERE S.SCHEMA_ID=O.SCHEMA_ID')};
COPY=ADD10
=SQL{?WC?' AND S.NAME=''DBO''')};
COPY=ADD10
=SQL{?WC?' AND O.TYPE IN(''U'',''V'',''P'',''TR'',''FN'')')};
COPY=ADD10
NAME=
***( COLUMN_VIEW )*******************************************
NAME=M_COLUMN_VIEW
=SET{WC.I=WC.INSERT+'''M'','};
COPY=ADD10
=SQL{?WC?'(SYSTEM_KIND,SYSTEM_REAL,SYSTEM_WORK')};
COPY=ADD10
=SQL{?WC?',SYSTEM_USER_X,SYSTEM_NAME,SYSTEM_SEQ')};
COPY=ADD10
=SQL{?WC?',SYSTEM_DATA_NAME,SYSTEM_DEFAULT_TYPE')};
COPY=ADD10
=SQL{?WC?',SYSTEM_DEFAULT_LENGTH1')};
COPY=ADD10
=SQL{?WC?',SYSTEM_DEFAULT_LENGTH2,SYSTEM_DEFAULT')};
COPY=ADD10
=SQL{?WC?',SYSTEM_NULL)AS SELECT CAST(CASE O.TYPE')};
COPY=ADD10
=SQL{?WC?' WHEN ''U'' THEN ''TABLE''')};
COPY=ADD10
=SQL{?WC?' WHEN ''V'' THEN ''VIEW''')};
COPY=ADD10
=SQL{?WC?' ELSE ''XXXXX'' END')};
COPY=ADD10
=SQL{?WC?' AS CHAR(5))')};
COPY=ADD10
=SQL{?WC?',CAST(''?_Q?_REAL_TEST?_Q?'' AS CHAR(4))')};
COPY=ADD10
=SQL{?WC?',CAST(''?WC.MAST_WORK?'' AS CHAR(4))')};
COPY=ADD10
=SQL{?WC?',CAST('' '' AS CHAR(1)),CAST(O.NAME')};
COPY=ADD10
=SQL{?WC?' AS NCHAR(30))')};
COPY=ADD10
=SQL{?WC?',CAST(C.COLUMN_ID AS INT)')};
COPY=ADD10
=SQL{?WC?',CAST(C.NAME AS NCHAR(30))')};
COPY=ADD10
=SQL{?WC?',CAST(UPPER(T.NAME)AS CHAR(9))')};
COPY=ADD10
=SQL{?WC?',CAST(CASE WHEN T.NAME IN(''BINARY''')};
COPY=ADD10
=SQL{?WC?',''CHAR'',''VARCHAR'',''DECIMAL''')};
COPY=ADD10
=SQL{?WC?',''NCHAR'',''NVARCHAR''')};
COPY=ADD10
=SQL{?WC?',''NUMERIC'') THEN CASE C.PRECISION')};
COPY=ADD10
=SQL{?WC?' WHEN 0 THEN CASE WHEN C.MAX_LENGTH<=0')};
COPY=ADD10
=SQL{?WC?' THEN 4000 ELSE CASE WHEN T.NAME')};
COPY=ADD10
=SQL{?WC?' IN(''NCHAR'',''NVARCHAR'') THEN')};
COPY=ADD10
=SQL{?WC?' C.MAX_LENGTH/2 ELSE C.MAX_LENGTH')};
COPY=ADD10
=SQL{?WC?' END END ELSE C.PRECISION END')};
COPY=ADD10
=SQL{?WC?' WHEN T.NAME=''DATETIME'' THEN 17')};
COPY=ADD10
=SQL{?WC?' WHEN T.NAME=''DATE'' THEN 8')};
COPY=ADD10
=SQL{?WC?' WHEN T.NAME=''TEXT'' THEN 4000')};
COPY=ADD10
=SQL{?WC?' ELSE 9 END AS INT),CAST(CASE')};
COPY=ADD10
=SQL{?WC?' WHEN T.NAME IN(''DECIMAL'',''NUMERIC'')')};
=COMPUTE{ W0+=100};SET{WC=WC.I+W0+',?_N?'};
=SQL{?WC?' THEN C.SCALE ELSE 0 END AS INT)')};
COPY=ADD10
=SQL{?WC?',CAST(CASE WHEN D.DEFINITION')};
COPY=ADD10
=SQL{?WC?' IS NULL THEN NULL WHEN')};
COPY=ADD10
=SQL{?WC?' DATALENGTH(RTRIM(D.DEFINITION))<3 THEN ')};
COPY=ADD10
=SQL{?WC?' D.DEFINITION ')};
COPY=ADD10
=SQL{?WC?' ELSE SUBSTRING(D.DEFINITION,2')};
COPY=ADD10
=SQL{?WC?',DATALENGTH(CONVERT(')};
COPY=ADD10
=SQL{?WC?' VARCHAR,D.DEFINITION))-2) END')};
COPY=ADD10
=SQL{?WC?' AS NCHAR(30))')};
COPY=ADD10
=SQL{?WC?',CAST(CASE WHEN C.IS_NULLABLE=''1''')};
COPY=ADD10
=SQL{?WC?' THEN ''1'' ELSE ''0'' END AS CHAR(1))')};
COPY=ADD10
=SQL{?WC?' FROM')};
COPY=ADD10
=SQL{?WC?' ?WC.M_DB?.SYS.COLUMNS C JOIN')};
COPY=ADD10
=SQL{?WC?' ?WC.M_DB?.SYS.OBJECTS O')};
COPY=ADD10
=SQL{?WC?' ON C.OBJECT_ID=O.OBJECT_ID AND O.TYPE')};
COPY=ADD10
=SQL{?WC?' IN(''U'',''V'')JOIN')};
COPY=ADD10
=SQL{?WC?' ?WC.M_DB?.SYS.SCHEMAS S')};
COPY=ADD10
=SQL{?WC?' ON S.SCHEMA_ID=O.SCHEMA_ID')};
COPY=ADD10
=SQL{?WC?' AND S.NAME=''DBO'' JOIN')};
COPY=ADD10
=SQL{?WC?' ?WC.M_DB?.SYS.TYPES T')};
COPY=ADD10
=SQL{?WC?' ON C.USER_TYPE_ID=T.USER_TYPE_ID ')};
COPY=ADD10
=SQL{?WC?' AND C.SYSTEM_TYPE_ID=T.SYSTEM_TYPE_ID')};
COPY=ADD10
=SQL{?WC?' LEFT JOIN')};
COPY=ADD10
=SQL{?WC?' ?WC.M_DB?.SYS')};
COPY=ADD10
=SQL{?WC?'.DEFAULT_CONSTRAINTS')};
COPY=ADD10
=SQL{?WC?' D ON D.OBJECT_ID=C.DEFAULT_OBJECT_ID')};
*****( INDEX_VIEW )******************************************
NAME=M_INDEX_VIEW
=SET{WC.I=WC.INSERT+'''M'','};
COPY=ADD10
=SQL{?WC?'(SYSTEM_REAL,SYSTEM_WORK,SYSTEM_USER_X')};
COPY=ADD10
=SQL{?WC?',SYSTEM_NAME,SYSTEM_DATA_NAME,SYSTEM_IX')};
COPY=ADD10
=SQL{?WC?',SYSTEM_NO)AS SELECT')};
COPY=ADD10
=SQL{?WC?' CAST(''?_Q?_REAL_TEST?_Q?'' AS CHAR(4))')};
COPY=ADD10
=SQL{?WC?',CAST(''?WC.MAST_WORK?'' AS CHAR(4))')};
COPY=ADD10
=SQL{?WC?',CAST('' '' AS CHAR(1))')};
COPY=ADD10
=SQL{?WC?',CAST(O.NAME AS NCHAR(30))')};
COPY=ADD10
=SQL{?WC?',CAST(C.NAME AS NCHAR(30))')};
COPY=ADD10
=SQL{?WC?',CAST(RIGHT(I.NAME,1) AS CHAR(1))')};
COPY=ADD10
=SQL{?WC?',CAST(K.KEY_ORDINAL-I.IS_UNIQUE AS INT)FROM')};
COPY=ADD10
=SQL{?WC?' ?WC.M_DB?.SYS.INDEXES I JOIN')};
COPY=ADD10
=SQL{?WC?' ?WC.M_DB?.SYS.INDEX_COLUMNS K')};
COPY=ADD10
=SQL{?WC?' ON I.INDEX_ID=K.INDEX_ID')};
COPY=ADD10
=SQL{?WC?' AND I.OBJECT_ID=K.OBJECT_ID JOIN')};
COPY=ADD10
=SQL{?WC?' ?WC.M_DB?.SYS.OBJECTS O')};
COPY=ADD10
=SQL{?WC?' ON O.OBJECT_ID=I.OBJECT_ID  ')};
COPY=ADD10
=SQL{?WC?' AND I.NAME IN(O.NAME+''0'',O.NAME+''1''')};
COPY=ADD10
=SQL{?WC?',O.NAME+''2'',O.NAME+''3'',O.NAME+''4''')};
COPY=ADD10
=SQL{?WC?',O.NAME+''5'',O.NAME+''6'',O.NAME+''7''')};
COPY=ADD10
=SQL{?WC?',O.NAME+''8'',O.NAME+''9'')')};
COPY=ADD10
=SQL{?WC?' AND O.TYPE IN(''U'',''V'') JOIN')};
COPY=ADD10
=SQL{?WC?' ?WC.M_DB?.SYS.COLUMNS C')};
COPY=ADD10
=SQL{?WC?' ON C.OBJECT_ID=I.OBJECT_ID')};
COPY=ADD10
=SQL{?WC?' AND C.COLUMN_ID=K.COLUMN_ID JOIN')};
COPY=ADD10
=SQL{?WC?' ?WC.M_DB?.SYS.SCHEMAS S')};
COPY=ADD10
=SQL{?WC?' ON S.SCHEMA_ID=O.SCHEMA_ID')};
COPY=ADD10
=SQL{?WC?' AND S.NAME=''DBO''')};
*****( GRANT_VIEW )******************************************
NAME=M_GRANT_VIEW
=SET{WC.I=WC.INSERT+'''M'','};
COPY=ADD10
=SQL{?WC?'(SYSTEM_KIND,SYSTEM_REAL,SYSTEM_WORK')};
COPY=ADD10
=SQL{?WC?',SYSTEM_USER_X,SYSTEM_NAME,SYSTEM_GRANT')};
COPY=ADD10
=SQL{?WC?',SYSTEM_SELECT,SYSTEM_INSERT')};
COPY=ADD10
=SQL{?WC?',SYSTEM_UPDATE,SYSTEM_DELETE')};
COPY=ADD10
=SQL{?WC?',SYSTEM_EXECUTE)AS SELECT CAST(CASE O.TYPE ')};
COPY=ADD10
=SQL{?WC?' WHEN ''U'' THEN ''TABLE''')};
COPY=ADD10
=SQL{?WC?' WHEN ''V'' THEN ''VIEW''')};
COPY=ADD10
=SQL{?WC?' WHEN ''P'' THEN ''PROC''')};
COPY=ADD10
=SQL{?WC?' WHEN ''FN'' THEN ''FUNC''')};
COPY=ADD10
=SQL{?WC?' WHEN ''TR'' THEN ''TRIG''')};
COPY=ADD10
=SQL{?WC?' ELSE ''XXXXX'' END AS CHAR(5))')};
COPY=ADD10
=SQL{?WC?',CAST(''?_Q?_REAL_TEST?_Q?'' AS CHAR(4))')};
COPY=ADD10
=SQL{?WC?',CAST(''?WC.MAST_WORK?'' AS CHAR(4))')};
COPY=ADD10
=SQL{?WC?',CAST('' '' AS CHAR(1))')};
COPY=ADD10
=SQL{?WC?',CAST(O.NAME AS NCHAR(30))')};
COPY=ADD10
=SQL{?WC?',CAST(UPPER(RIGHT(U0.NAME,6)) AS CHAR(6))')};
COPY=ADD10
=SQL{?WC?',CAST(CASE SUBSTRING(P0.TYPE,1,1)')};
COPY=ADD10
=SQL{?WC?' WHEN ''S'' THEN ''S'' ')};
COPY=ADD10
=SQL{?WC?' ELSE '' '' END AS CHAR(1))')};
COPY=ADD10
=SQL{?WC?',CAST(SUBSTRING(P1.TYPE,1,1) AS CHAR(1))')};
COPY=ADD10
=SQL{?WC?',CAST(SUBSTRING(P2.TYPE,1,1) AS CHAR(1))')};
COPY=ADD10
=SQL{?WC?',CAST(SUBSTRING(P3.TYPE,1,1) AS CHAR(1))')};
COPY=ADD10
=SQL{?WC?',CAST(CASE SUBSTRING(P0.TYPE,1,1)')};
COPY=ADD10
=SQL{?WC?' WHEN ''E'' THEN ''E'' ')};
COPY=ADD10
=SQL{?WC?' ELSE '' '' END AS CHAR(1)) FROM')};
COPY=ADD10
=SQL{?WC?' ?WC.M_DB?.SYS.OBJECTS O JOIN')};
COPY=ADD10
=SQL{?WC?' ?WC.M_DB?.SYS')};
COPY=ADD10
=SQL{?WC?'.DATABASE_PERMISSIONS')};
COPY=ADD10
=SQL{?WC?' P0 ON O.OBJECT_ID=P0.MAJOR_ID')};
COPY=ADD10
=SQL{?WC?' AND (P0.TYPE=''SL'' ')};
COPY=ADD10
=SQL{?WC?' AND O.TYPE IN(''U'',''V'')')};
COPY=ADD10
=SQL{?WC?' OR P0.TYPE=''EX'' ')};
COPY=ADD10
=SQL{?WC?' AND O.TYPE IN(''P'',''FN''))JOIN')};
COPY=ADD10
=SQL{?WC?' ?WC.M_DB?.SYS')};
COPY=ADD10
=SQL{?WC?'.DATABASE_PRINCIPALS')};
COPY=ADD10
=SQL{?WC?' U0 ON (U0.NAME LIKE ')};
COPY=ADD10
=SQL{?WC?' ''?_Q?_DB_HEADER?_Q?%''')};
COPY=ADD10
=SQL{?WC?' OR U0.NAME=LOWER(''PUBLIC''))')};
COPY=ADD10
=SQL{?WC?' AND P0.GRANTEE_PRINCIPAL_ID')};
COPY=ADD10
=SQL{?WC?'=U0.PRINCIPAL_ID LEFT JOIN')};
COPY=ADD10
=SQL{?WC?' ?WC.M_DB?.SYS')};
COPY=ADD10
=SQL{?WC?'.DATABASE_PERMISSIONS')};
COPY=ADD10
=SQL{?WC?' P1 ON O.OBJECT_ID=P1.MAJOR_ID AND')};
COPY=ADD10
=SQL{?WC?' P0.GRANTOR_PRINCIPAL_ID')};
COPY=ADD10
=SQL{?WC?'=P1.GRANTOR_PRINCIPAL_ID')};
COPY=ADD10
=SQL{?WC?' AND P1.TYPE=''IN'' AND ')};
COPY=ADD10
=SQL{?WC?' P0.GRANTEE_PRINCIPAL_ID')};
COPY=ADD10
=SQL{?WC?'=P1.GRANTEE_PRINCIPAL_ID LEFT JOIN')};
COPY=ADD10
=SQL{?WC?' ?WC.M_DB?.SYS')};
COPY=ADD10
=SQL{?WC?'.DATABASE_PRINCIPALS')};
COPY=ADD10
=SQL{?WC?' U1 ON U0.NAME=U1.NAME ')};
COPY=ADD10
=SQL{?WC?' AND P1.GRANTEE_PRINCIPAL_ID')};
COPY=ADD10
=SQL{?WC?'=U1.PRINCIPAL_ID LEFT JOIN')};
COPY=ADD10
=SQL{?WC?' ?WC.M_DB?.SYS')};
COPY=ADD10
=SQL{?WC?'.DATABASE_PERMISSIONS')};
COPY=ADD10
=SQL{?WC?' P2 ON O.OBJECT_ID=P2.MAJOR_ID AND')};
COPY=ADD10
=SQL{?WC?' P0.GRANTOR_PRINCIPAL_ID')};
COPY=ADD10
=SQL{?WC?'=P2.GRANTOR_PRINCIPAL_ID')};
COPY=ADD10
=SQL{?WC?' AND P2.TYPE=''UP'' AND ')};
COPY=ADD10
=SQL{?WC?' P0.GRANTEE_PRINCIPAL_ID')};
COPY=ADD10
=SQL{?WC?'=P2.GRANTEE_PRINCIPAL_ID LEFT JOIN')};
COPY=ADD10
=SQL{?WC?' ?WC.M_DB?.SYS')};
COPY=ADD10
=SQL{?WC?'.DATABASE_PRINCIPALS')};
COPY=ADD10
=SQL{?WC?' U2 ON U0.NAME=U2.NAME AND ')};
COPY=ADD10
=SQL{?WC?' P2.GRANTEE_PRINCIPAL_ID')};
COPY=ADD10
=SQL{?WC?'=U2.PRINCIPAL_ID LEFT JOIN ')};
COPY=ADD10
=SQL{?WC?' ?WC.M_DB?.SYS')};
COPY=ADD10
=SQL{?WC?'.DATABASE_PERMISSIONS')};
COPY=ADD10
=SQL{?WC?' P3 ON O.OBJECT_ID=P3.MAJOR_ID AND')};
COPY=ADD10
=SQL{?WC?' P0.GRANTOR_PRINCIPAL_ID')};
COPY=ADD10
=SQL{?WC?'=P3.GRANTOR_PRINCIPAL_ID')};
COPY=ADD10
=SQL{?WC?' AND P3.TYPE=''DE'' AND')};
COPY=ADD10
=SQL{?WC?' P0.GRANTEE_PRINCIPAL_ID')};
COPY=ADD10
=SQL{?WC?'=P3.GRANTEE_PRINCIPAL_ID LEFT JOIN')};
COPY=ADD10
=SQL{?WC?' ?WC.M_DB?.SYS')};
COPY=ADD10
=SQL{?WC?'.DATABASE_PRINCIPALS')};
COPY=ADD10
=SQL{?WC?' U3 ON U0.NAME=U3.NAME AND')};
COPY=ADD10
=SQL{?WC?' P3.GRANTEE_PRINCIPAL_ID')};
COPY=ADD10
=SQL{?WC?'=U3.PRINCIPAL_ID')};
NAME=
*************************************************************
=M_SKIP:
*(PERMISSION_END)*
