DatabaseProcApplicationCreatedLinks
sybsystemprocssp_ijdbc_getcolumnprivileges  31 Aug 14Defects Dependencies

1     
2     /*
3     ** sp_ijdbc_getcolumnprivilege 
4     */
5     
6     create procedure sp_ijdbc_getcolumnprivileges(
7         @table_qualifier varchar(32) = null,
8         @table_owner varchar(32) = null,
9         @table_name varchar(257) = null,
10        @column_name varchar(257) = null)
11    as
12    
13        declare @tablename varchar(257)
14        declare @tableowner varchar(128)
15        declare @privlist varchar(128)
16        declare @privdef varchar(128)
17        declare @searchstr char(3)
18        declare @msg varchar(255)
19    
20        select @searchstr = 'SUV' /* SYSTEM USER VIEW types only */
21    
22        select @privlist = '193      ' + /* SELECT    */
23            '151      ' + /* REFERENCE */
24            '197      ' + /* UPDATE    */
25            '196      ' + /* DELETE    */
26            '195      ' /* INSERT    */
27    
28        select @privdef = 'SELECT   ' +
29            'REFERENCE' +
30            'UPDATE   ' +
31            'DELETE   ' +
32            'INSERT   '
33    
34    
35        select @tablename = @table_name
36        select @tableowner = @table_owner
37    
38        if (@tableowner is null)
39        begin
40            select @tableowner = '%'
41        end
42    
43        if (@tablename is null)
44        begin
45            select @tablename = '%'
46        end
47    
48        set nocount on
49        if @@trancount = 0
50        begin
51            set chained off
52        end
53        else
54        begin
55            /* we are inside a transaction. catalog procedure sp_column privileges
56            ** can't be run inside a transaction 
57            */
58            exec sp_getmessage 18040, @msg output
59            raiserror 18040, @msg, 'sp_column_privileges'
60            return (1)
61        end
62    
63        set transaction isolation level 1
64    
65        /*  If this is a temporary table; object does not belong to 
66        **  this database; (we should be in our temporary database)
67        */
68        if (@table_name like '#%' and db_name() != db_name(tempdb_id()))
69        begin
70            /* 
71            ** 17676, 'This may be a temporary object. Please execute 
72            ** procedure from your temporary database.'
73            */
74            exec sp_getmessage 17676, @msg out
75            raiserror 17676 @msg
76            return (1)
77        end
78    
79        /*
80        ** The table_qualifier should be same as the database name. Do the sanity 
81        ** check if it is specified
82        */
83        if (@table_qualifier is null) or (@table_qualifier = '')
84            /* set the table qualifier name */
85            select @table_qualifier = db_name()
86        else
87        begin
88            if db_name() != @table_qualifier
89            begin
90                exec sp_getmessage 18039, @msg out
91                raiserror 18039 @msg
92                return (1)
93            end
94        end
95    
96        /* 
97        ** if the table owner is not specified, it will be taken as the id of the
98        ** user executing this procedure. Otherwise find the explicit table name 
99        ** prefixed by the owner id
100       */
101   
102       /*
103       ** NOTE: SQL Server allows an underscore '_' in the table owner, even 
104       **       though '_' is a single character wildcard.
105       */
106       if (charindex('%', @table_owner) > 0)
107       begin
108           exec sp_getmessage 17993, @msg output
109           raiserror 17993 @msg, @table_owner
110           return (1)
111       end
112   
113       if (@table_owner is null)
114       begin
115           exec sp_getmessage 17993, @msg output
116           raiserror 17993 @msg, 'NULL'
117           return (1)
118       end
119       else
120       begin
121           exec sp_ijdbc_escapeliteralforlike @table_owner output
122       end
123   
124       if (@table_name is null)
125       begin
126           exec sp_getmessage 17993, @msg output
127           raiserror 17993 @msg, 'NULL'
128           return (1)
129       end
130   
131       if (select count(*) from sysobjects
132               where user_name(uid) like @table_owner ESCAPE '\'
133                   and name like @table_name ESCAPE '\'
134                   AND charindex(substring(type, 1, 1), @searchstr) != 0
135               ) = 0
136       begin
137           exec sp_getmessage 17674, @msg output
138           raiserror 17674 @msg
139           return 1
140       end
141   
142       if @column_name is null
143           select @column_name = '%'
144       else
145       begin
146           if not exists (select * from syscolumns c, sysobjects o
147                   where user_name(o.uid) like @table_owner ESCAPE '\'
148                       and o.name like @table_name ESCAPE '\'
149                       and (charindex(substring(o.type, 1, 1), @searchstr) != 0)
150                       and c.id = o.id and c.name like @column_name ESCAPE '\')
151           begin
152               exec sp_getmessage 17563, @msg output
153               raiserror 17563 @msg, @column_name
154               return (1)
155           end
156       end
157   
158   
159       select uid = o.uid, user_name = user_name(o.uid),
160           oid = o.id, table_name = o.name, colid = c.colid,
161           col_name = c.name, type = o.type
162       into #objects_id
163       from syscolumns c, sysobjects o
164       where user_name(o.uid) like @table_owner ESCAPE '\'
165           and o.name like @table_name ESCAPE '\'
166           and (charindex(substring(o.type, 1, 1), @searchstr) != 0)
167           and c.id = o.id and c.name like @column_name ESCAPE '\'
168   
169   
170       create table #tmp_grp_getcolumnprivileges(TABLE_CAT varchar(32) null, TABLE_SCHEM varchar(32) null, TABLE_NAME varchar(257) null, COLUMN_NAME varchar(257) null, GRANTOR varchar(32) null, UID int null, GRANTEE varchar(32) null, PRIVILEGE varchar(128) null, IS_GRANTABLE char(3) null)
171   
172       delete #tmp_getcolumnprivileges
173   
174       insert #tmp_grp_getcolumnprivileges
175       SELECT 'TABLE_CAT' = db_name(), 'TABLE_SCHEM' = t.user_name,
176           'TABLE_NAME' = t.table_name, 'COLUMN_NAME' = t.col_name,
177           'GRANTOR' = t.user_name,
178           'UID' = t.uid,
179           'GRANTEE' = t.user_name, 'PRIVILEGE' = 'SELECT', 'IS_GRANTABLE' =
180           substring('YESNO ', (select isnull((select p.protecttype
181                           where p.id = t.oid
182                               AND p.protecttype != 2
183                               AND p.grantor = p.uid
184                               AND p.action = 193), 0)) * 3 + 1, 3)
185   
186       FROM #objects_id as t, sysprotects as p
187       WHERE
188           not exists (select * from sysobjects s1, sysprotects p1 WHERE
189                   name LIKE @tablename ESCAPE '\'
190                   AND user_name(t.uid) LIKE @tableowner ESCAPE '\'
191                   AND charindex(substring(type, 1, 1), @searchstr) != 0
192                   AND s1.id = p1.id
193                   AND p1.grantor = p1.uid
194                   AND p1.action = 193
195                   AND p1.protecttype = 2)
196           AND (t.colid in (select v.number
197                   from master.dbo.spt_values v
198                   where convert(tinyint, substring(isnull(p.columns, 0x1),
199                           v.low, 1)) & v.high != 0
200                       and v.type = "P" and v.number <= 1024)
201               or 0 in (select v.number
202                   from master.dbo.spt_values v
203                   where convert(tinyint, substring(isnull(p.columns, 0x1),
204                           v.low, 1)) & v.high != 0
205                       and v.type = "P" and v.number <= 1024)
206           )
207   
208   
209       UNION
210       SELECT 'TABLE_CAT' = db_name(), 'TABLE_SCHEM' = t.user_name,
211           'TABLE_NAME' = t.table_name, 'COLUMN_NAME' = t.col_name,
212           'GRANTOR' = t.user_name,
213           'UID' = t.uid,
214           'GRANTEE' = t.user_name, 'PRIVILEGE' = 'INSERT', 'IS_GRANTABLE' =
215           substring('YESNO ', (select isnull((select p.protecttype
216                           where p.id = t.oid
217                               AND p.protecttype != 2
218                               AND p.grantor = p.uid
219                               AND p.action = 195), 0)) * 3 + 1, 3)
220       FROM #objects_id as t, sysprotects as p
221       WHERE
222           not exists (select * from sysobjects s1, sysprotects p1 WHERE
223                   name LIKE @tablename ESCAPE '\'
224                   AND user_name(t.uid) LIKE @tableowner ESCAPE '\'
225                   AND charindex(substring(type, 1, 1), @searchstr) != 0
226                   AND s1.id = p1.id
227                   AND p1.grantor = p1.uid
228                   AND p1.action = 195
229                   AND p1.protecttype = 2)
230           AND (t.colid in (select v.number
231                   from master.dbo.spt_values v
232                   where convert(tinyint, substring(isnull(p.columns, 0x1),
233                           v.low, 1)) & v.high != 0
234                       and v.type = "P" and v.number <= 1024)
235               or 0 in (select v.number
236                   from master.dbo.spt_values v
237                   where convert(tinyint, substring(isnull(p.columns, 0x1),
238                           v.low, 1)) & v.high != 0
239                       and v.type = "P" and v.number <= 1024)
240           )
241   
242       UNION
243       SELECT 'TABLE_CAT' = db_name(), 'TABLE_SCHEM' = t.user_name,
244           'TABLE_NAME' = t.table_name, 'COLUMN_NAME' = t.col_name,
245           'GRANTOR' = t.user_name,
246           'UID' = t.uid,
247           'GRANTEE' = t.user_name, 'PRIVILEGE' = 'DELETE', 'IS_GRANTABLE' =
248           substring('YESNO ', (select isnull((select p.protecttype
249                           where p.id = t.oid
250                               AND p.protecttype != 2
251                               AND p.grantor = p.uid
252                               AND p.action = 196), 0)) * 3 + 1, 3)
253       FROM #objects_id as t, sysprotects as p
254       WHERE
255           not exists (select * from sysobjects s1, sysprotects p1 WHERE
256                   name LIKE @tablename ESCAPE '\'
257                   AND user_name(t.uid) LIKE @tableowner ESCAPE '\'
258                   AND charindex(substring(type, 1, 1), @searchstr) != 0
259                   AND s1.id = p1.id
260                   AND p1.grantor = p1.uid
261                   AND p1.action = 196
262                   AND p1.protecttype = 2)
263           AND (t.colid in (select v.number
264                   from master.dbo.spt_values v
265                   where convert(tinyint, substring(isnull(p.columns, 0x1),
266                           v.low, 1)) & v.high != 0
267                       and v.type = "P" and v.number <= 1024)
268               or 0 in (select v.number
269                   from master.dbo.spt_values v
270                   where convert(tinyint, substring(isnull(p.columns, 0x1),
271                           v.low, 1)) & v.high != 0
272                       and v.type = "P" and v.number <= 1024)
273           )
274   
275       UNION
276       SELECT 'TABLE_CAT' = db_name(), 'TABLE_SCHEM' = t.user_name,
277           'TABLE_NAME' = t.table_name, 'COLUMN_NAME' = t.col_name,
278           'GRANTOR' = t.user_name,
279           'UID' = t.uid,
280           'GRANTEE' = t.user_name, 'PRIVILEGE' = 'UPDATE', 'IS_GRANTABLE' =
281           substring('YESNO ', (select isnull((select p.protecttype
282                           where p.id = t.oid
283                               AND p.protecttype != 2
284                               AND p.grantor = p.uid
285                               AND p.action = 197), 0)) * 3 + 1, 3)
286       FROM #objects_id as t, sysprotects as p
287       WHERE
288           not exists (select * from sysobjects s1, sysprotects p1 WHERE
289                   name LIKE @tablename ESCAPE '\'
290                   AND user_name(t.uid) LIKE @tableowner ESCAPE '\'
291                   AND charindex(substring(type, 1, 1), @searchstr) != 0
292                   AND s1.id = p1.id
293                   AND p1.grantor = p1.uid
294                   AND p1.action = 197
295                   AND p1.protecttype = 2)
296           AND (t.colid in (select v.number
297                   from master.dbo.spt_values v
298                   where convert(tinyint, substring(isnull(p.columns, 0x1),
299                           v.low, 1)) & v.high != 0
300                       and v.type = "P" and v.number <= 1024)
301               or 0 in (select v.number
302                   from master.dbo.spt_values v
303                   where convert(tinyint, substring(isnull(p.columns, 0x1),
304                           v.low, 1)) & v.high != 0
305                       and v.type = "P" and v.number <= 1024)
306           )
307   
308       UNION
309       SELECT 'TABLE_CAT' = db_name(), 'TABLE_SCHEM' = t.user_name,
310           'TABLE_NAME' = t.table_name, 'COLUMN_NAME' = t.col_name,
311           'GRANTOR' = t.user_name,
312           'UID' = t.uid,
313           'GRANTEE' = t.user_name, 'PRIVILEGE' = 'REFERENCE', 'IS_GRANTABLE' =
314   
315           substring('YESNO ', (select isnull((select p.protecttype
316                           where p.id = t.oid
317                               AND p.protecttype != 2
318                               AND p.grantor = p.uid
319                               AND p.action = 151), 0)) * 3 + 1, 3)
320       FROM #objects_id as t, sysprotects as p
321       WHERE
322   
323           not exists (select * from sysobjects s1, sysprotects p1 WHERE
324                   name LIKE @tablename ESCAPE '\'
325                   AND user_name(t.uid) LIKE @tableowner ESCAPE '\'
326                   AND charindex(substring(type, 1, 1), @searchstr) != 0
327                   AND s1.id = p1.id
328                   AND p1.grantor = p1.uid
329                   AND p1.action = 151
330                   AND p1.protecttype = 2)
331           AND (t.colid in (select v.number
332                   from master.dbo.spt_values v
333                   where convert(tinyint, substring(isnull(p.columns, 0x1),
334                           v.low, 1)) & v.high != 0
335                       and v.type = "P" and v.number <= 1024)
336               or 0 in (select v.number
337                   from master.dbo.spt_values v
338                   where convert(tinyint, substring(isnull(p.columns, 0x1),
339                           v.low, 1)) & v.high != 0
340                       and v.type = "P" and v.number <= 1024)
341           )
342   
343   
344       UNION
345       SELECT 'TABLE_CAT' = db_name(), 'TABLE_SCHEM' = t.user_name,
346           'TABLE_NAME' = t.table_name, 'COLUMN_NAME' = t.col_name,
347           'GRANTOR' = user_name(p.grantor),
348           'UID' = p.uid,
349           'GRANTEE' = user_name(p.uid),
350           'PRIVILEGE' =
351           rtrim(substring(@privdef,
352                   charindex(rtrim(convert(char, p.action)), @privlist), 9)),
353           substring('YESNO ', (p.protecttype * 3) + 1, 3)
354       FROM sysprotects p, #objects_id as t
355       WHERE t.oid = p.id and protecttype < 2
356           AND p.action in (193, 151, 197, 196, 195)
357           AND charindex(substring(t.type, 1, 1), @searchstr) != 0
358           AND (t.colid in (select v.number
359                   from master.dbo.spt_values v
360                   where convert(tinyint, substring(isnull(p.columns, 0x1),
361                           v.low, 1)) & v.high != 0
362                       and v.type = "P" and v.number <= 1024)
363               or 0 in (select v.number
364                   from master.dbo.spt_values v
365                   where convert(tinyint, substring(isnull(p.columns, 0x1),
366                           v.low, 1)) & v.high != 0
367                       and v.type = "P" and v.number <= 1024)
368           )
369   
370   
371       ORDER BY TABLE_SCHEM, TABLE_NAME, PRIVILEGE
372   
373   
374   
375   
376       /** Propagate the privileges from the groups 
377       ** to the groups members.
378       **/
379   
380   
381       insert #tmp_getcolumnprivileges
382       select t.TABLE_CAT, t.TABLE_SCHEM, t.TABLE_NAME,
383           t.COLUMN_NAME, t.GRANTOR, 'GRANTEE' = su.name, t.PRIVILEGE,
384           t.IS_GRANTABLE
385   
386       from #tmp_grp_getcolumnprivileges t, sysusers su
387       where
388           t.UID = su.uid
389           and su.gid != su.uid
390   
391       union
392   
393       select t.TABLE_CAT, t.TABLE_SCHEM, t.TABLE_NAME,
394           t.COLUMN_NAME, t.GRANTOR, 'GRANTEE' = su.name, t.PRIVILEGE,
395           t.IS_GRANTABLE
396       from #tmp_grp_getcolumnprivileges t, sysusers su
397       where
398           t.UID = su.gid
399           and su.gid != su.uid
400   
401   
402   
403   
404   /*
405   ** End of sp_ijdbc_getcolumnprivileges
406   */
407   
408   


exec sp_procxmode 'sp_ijdbc_getcolumnprivileges', 'AnyMode'
go

Grant Execute on sp_ijdbc_getcolumnprivileges to public
go
DEFECTS
 QJWI 5 Join or Sarg Without Index 198
 QJWI 5 Join or Sarg Without Index 203
 QJWI 5 Join or Sarg Without Index 232
 QJWI 5 Join or Sarg Without Index 237
 QJWI 5 Join or Sarg Without Index 265
 QJWI 5 Join or Sarg Without Index 270
 QJWI 5 Join or Sarg Without Index 298
 QJWI 5 Join or Sarg Without Index 303
 QJWI 5 Join or Sarg Without Index 333
 QJWI 5 Join or Sarg Without Index 338
 QJWI 5 Join or Sarg Without Index 360
 QJWI 5 Join or Sarg Without Index 365
 MEST 4 Empty String will be replaced by Single Space 83
 MINU 4 Unique Index with nullable columns sybsystemprocs..sysprotects sybsystemprocs..sysprotects
 QCSC 4 Costly 'select count()', use 'exists()' 131
 QPUI 4 Join or Sarg with Un-Rooted Partial Index Use SARG Candidate index: sysprotects.csysprotects unique clustered
(id, action, grantor, uid, protecttype)
Intersection: {protecttype, action}
182
 QPUI 4 Join or Sarg with Un-Rooted Partial Index Use SARG Candidate index: sysprotects.csysprotects unique clustered
(id, action, grantor, uid, protecttype)
Intersection: {protecttype, action}
194
 QPUI 4 Join or Sarg with Un-Rooted Partial Index Use SARG Candidate index: sysprotects.csysprotects unique clustered
(id, action, grantor, uid, protecttype)
Intersection: {protecttype, action}
217
 QPUI 4 Join or Sarg with Un-Rooted Partial Index Use SARG Candidate index: sysprotects.csysprotects unique clustered
(id, action, grantor, uid, protecttype)
Intersection: {protecttype, action}
228
 QPUI 4 Join or Sarg with Un-Rooted Partial Index Use SARG Candidate index: sysprotects.csysprotects unique clustered
(id, action, grantor, uid, protecttype)
Intersection: {protecttype, action}
250
 QPUI 4 Join or Sarg with Un-Rooted Partial Index Use SARG Candidate index: sysprotects.csysprotects unique clustered
(id, action, grantor, uid, protecttype)
Intersection: {protecttype, action}
261
 QPUI 4 Join or Sarg with Un-Rooted Partial Index Use SARG Candidate index: sysprotects.csysprotects unique clustered
(id, action, grantor, uid, protecttype)
Intersection: {protecttype, action}
283
 QPUI 4 Join or Sarg with Un-Rooted Partial Index Use SARG Candidate index: sysprotects.csysprotects unique clustered
(id, action, grantor, uid, protecttype)
Intersection: {protecttype, action}
294
 QPUI 4 Join or Sarg with Un-Rooted Partial Index Use SARG Candidate index: sysprotects.csysprotects unique clustered
(id, action, grantor, uid, protecttype)
Intersection: {protecttype, action}
317
 QPUI 4 Join or Sarg with Un-Rooted Partial Index Use SARG Candidate index: sysprotects.csysprotects unique clustered
(id, action, grantor, uid, protecttype)
Intersection: {protecttype, action}
329
 QPUI 4 Join or Sarg with Un-Rooted Partial Index Use SARG Candidate index: sysprotects.csysprotects unique clustered
(id, action, grantor, uid, protecttype)
Intersection: {protecttype, action}
355
 QTYP 4 Comparison type mismatch Comparison type mismatch: tinyint vs int 182
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 184
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 194
 QTYP 4 Comparison type mismatch Comparison type mismatch: tinyint vs int 195
 QTYP 4 Comparison type mismatch Comparison type mismatch: tinyint vs int 217
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 219
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 228
 QTYP 4 Comparison type mismatch Comparison type mismatch: tinyint vs int 229
 QTYP 4 Comparison type mismatch Comparison type mismatch: tinyint vs int 250
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 252
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 261
 QTYP 4 Comparison type mismatch Comparison type mismatch: tinyint vs int 262
 QTYP 4 Comparison type mismatch Comparison type mismatch: tinyint vs int 283
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 285
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 294
 QTYP 4 Comparison type mismatch Comparison type mismatch: tinyint vs int 295
 QTYP 4 Comparison type mismatch Comparison type mismatch: tinyint vs int 317
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 319
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 329
 QTYP 4 Comparison type mismatch Comparison type mismatch: tinyint vs int 330
 QTYP 4 Comparison type mismatch Comparison type mismatch: tinyint vs int 355
 TNOU 4 Table with no unique index master..spt_values master..spt_values
 MBLI 3 Integer Value of Binary Literal is Platform Dependant 198
 MBLI 3 Integer Value of Binary Literal is Platform Dependant 203
 MBLI 3 Integer Value of Binary Literal is Platform Dependant 232
 MBLI 3 Integer Value of Binary Literal is Platform Dependant 237
 MBLI 3 Integer Value of Binary Literal is Platform Dependant 265
 MBLI 3 Integer Value of Binary Literal is Platform Dependant 270
 MBLI 3 Integer Value of Binary Literal is Platform Dependant 298
 MBLI 3 Integer Value of Binary Literal is Platform Dependant 303
 MBLI 3 Integer Value of Binary Literal is Platform Dependant 333
 MBLI 3 Integer Value of Binary Literal is Platform Dependant 338
 MBLI 3 Integer Value of Binary Literal is Platform Dependant 360
 MBLI 3 Integer Value of Binary Literal is Platform Dependant 365
 MGTP 3 Grant to public master..spt_values  
 MGTP 3 Grant to public sybsystemprocs..sp_ijdbc_getcolumnprivileges  
 MGTP 3 Grant to public sybsystemprocs..syscolumns  
 MGTP 3 Grant to public sybsystemprocs..sysobjects  
 MGTP 3 Grant to public sybsystemprocs..sysprotects  
 MGTP 3 Grant to public sybsystemprocs..sysusers  
 MNEJ 3 'Not Equal' join 389
 MNEJ 3 'Not Equal' join 399
 MNER 3 No Error Check should check return value of exec 58
 MNER 3 No Error Check should check return value of exec 74
 MNER 3 No Error Check should check return value of exec 90
 MNER 3 No Error Check should check return value of exec 108
 MNER 3 No Error Check should check return value of exec 115
 MNER 3 No Error Check should check return value of exec 121
 MNER 3 No Error Check should check return value of exec 126
 MNER 3 No Error Check should check return value of exec 137
 MNER 3 No Error Check should check return value of exec 152
 MNER 3 No Error Check should check @@error after select into 159
 MNER 3 No Error Check should check @@error after delete 172
 MNER 3 No Error Check should check @@error after insert 174
 MNER 3 No Error Check should check @@error after insert 381
 MUCO 3 Useless Code Useless Brackets in create proc 6
 MUCO 3 Useless Code Useless Brackets 38
 MUCO 3 Useless Code Useless Brackets 43
 MUCO 3 Useless Code Useless Brackets 60
 MUCO 3 Useless Code Useless Brackets 68
 MUCO 3 Useless Code Useless Brackets 76
 MUCO 3 Useless Code Useless Brackets 92
 MUCO 3 Useless Code Useless Brackets 106
 MUCO 3 Useless Code Useless Brackets 110
 MUCO 3 Useless Code Useless Brackets 113
 MUCO 3 Useless Code Useless Brackets 117
 MUCO 3 Useless Code Useless Brackets 124
 MUCO 3 Useless Code Useless Brackets 128
 MUCO 3 Useless Code Useless Brackets 154
 MUCO 3 Useless Code Useless Brackets 353
 QGWO 3 Group by/Distinct/Union without order by 382
 QISO 3 Set isolation level 63
 QJWT 3 Join or Sarg Without Index on temp table 181
 QJWT 3 Join or Sarg Without Index on temp table 196
 QJWT 3 Join or Sarg Without Index on temp table 216
 QJWT 3 Join or Sarg Without Index on temp table 230
 QJWT 3 Join or Sarg Without Index on temp table 249
 QJWT 3 Join or Sarg Without Index on temp table 263
 QJWT 3 Join or Sarg Without Index on temp table 282
 QJWT 3 Join or Sarg Without Index on temp table 296
 QJWT 3 Join or Sarg Without Index on temp table 316
 QJWT 3 Join or Sarg Without Index on temp table 331
 QJWT 3 Join or Sarg Without Index on temp table 355
 QJWT 3 Join or Sarg Without Index on temp table 358
 QJWT 3 Join or Sarg Without Index on temp table 388
 QJWT 3 Join or Sarg Without Index on temp table 398
 QNAJ 3 Not using ANSI Inner Join 146
 QNAJ 3 Not using ANSI Inner Join 163
 QNAJ 3 Not using ANSI Inner Join 186
 QNAJ 3 Not using ANSI Inner Join 188
 QNAJ 3 Not using ANSI Inner Join 220
 QNAJ 3 Not using ANSI Inner Join 222
 QNAJ 3 Not using ANSI Inner Join 253
 QNAJ 3 Not using ANSI Inner Join 255
 QNAJ 3 Not using ANSI Inner Join 286
 QNAJ 3 Not using ANSI Inner Join 288
 QNAJ 3 Not using ANSI Inner Join 320
 QNAJ 3 Not using ANSI Inner Join 323
 QNAJ 3 Not using ANSI Inner Join 354
 QNAJ 3 Not using ANSI Inner Join 386
 QNAJ 3 Not using ANSI Inner Join 396
 QNUA 3 Should use Alias: Column name should use alias s1 189
 QNUA 3 Should use Alias: Column type should use alias s1 191
 QNUA 3 Should use Alias: Column name should use alias s1 223
 QNUA 3 Should use Alias: Column type should use alias s1 225
 QNUA 3 Should use Alias: Column name should use alias s1 256
 QNUA 3 Should use Alias: Column type should use alias s1 258
 QNUA 3 Should use Alias: Column name should use alias s1 289
 QNUA 3 Should use Alias: Column type should use alias s1 291
 QNUA 3 Should use Alias: Column name should use alias s1 324
 QNUA 3 Should use Alias: Column type should use alias s1 326
 QNUA 3 Should use Alias: Column protecttype should use alias p 355
 QPRI 3 Join or Sarg with Rooted Partial Index Use SARG Candidate index: sysobjects.ncsysobjects unique
(name, uid)
Intersection: {name}
189
 QPRI 3 Join or Sarg with Rooted Partial Index Use SARG Candidate index: sysobjects.ncsysobjects unique
(name, uid)
Intersection: {name}
223
 QPRI 3 Join or Sarg with Rooted Partial Index Use SARG Candidate index: sysobjects.ncsysobjects unique
(name, uid)
Intersection: {name}
256
 QPRI 3 Join or Sarg with Rooted Partial Index Use SARG Candidate index: sysobjects.ncsysobjects unique
(name, uid)
Intersection: {name}
289
 QPRI 3 Join or Sarg with Rooted Partial Index Use SARG Candidate index: sysobjects.ncsysobjects unique
(name, uid)
Intersection: {name}
324
 QUNI 3 Check Use of 'union' vs 'union all' 175
 QUNI 3 Check Use of 'union' vs 'union all' 382
 MSUB 2 Subquery Marker 131
 MSUB 2 Subquery Marker 146
 MSUC 2 Correlated Subquery Marker 180
 MSUC 2 Correlated Subquery Marker 188
 MSUC 2 Correlated Subquery Marker 196
 MSUC 2 Correlated Subquery Marker 201
 MSUC 2 Correlated Subquery Marker 215
 MSUC 2 Correlated Subquery Marker 222
 MSUC 2 Correlated Subquery Marker 230
 MSUC 2 Correlated Subquery Marker 235
 MSUC 2 Correlated Subquery Marker 248
 MSUC 2 Correlated Subquery Marker 255
 MSUC 2 Correlated Subquery Marker 263
 MSUC 2 Correlated Subquery Marker 268
 MSUC 2 Correlated Subquery Marker 281
 MSUC 2 Correlated Subquery Marker 288
 MSUC 2 Correlated Subquery Marker 296
 MSUC 2 Correlated Subquery Marker 301
 MSUC 2 Correlated Subquery Marker 315
 MSUC 2 Correlated Subquery Marker 323
 MSUC 2 Correlated Subquery Marker 331
 MSUC 2 Correlated Subquery Marker 336
 MSUC 2 Correlated Subquery Marker 358
 MSUC 2 Correlated Subquery Marker 363
 MTR1 2 Metrics: Comments Ratio Comments: 7% 6
 MTR2 2 Metrics: Cyclomatic Complexity Cyclo: 17 = 24dec - 9exi + 2 6
 MTR3 2 Metrics: Query Complexity Complexity: 255 6
 PRED_QUERY_COLLECTION 2 {c=sybsystemprocs..syscolumns, o=sybsystemprocs..sysobjects} 0 146
 PRED_QUERY_COLLECTION 2 {c=sybsystemprocs..syscolumns, o=sybsystemprocs..sysobjects} 0 159
 PRED_QUERY_COLLECTION 2 {o=sybsystemprocs..sysobjects, p=sybsystemprocs..sysprotects} 0 188
 PRED_QUERY_COLLECTION 2 {o=sybsystemprocs..sysobjects, p=sybsystemprocs..sysprotects} 0 222
 PRED_QUERY_COLLECTION 2 {o=sybsystemprocs..sysobjects, p=sybsystemprocs..sysprotects} 0 255
 PRED_QUERY_COLLECTION 2 {o=sybsystemprocs..sysobjects, p=sybsystemprocs..sysprotects} 0 288
 PRED_QUERY_COLLECTION 2 {o=sybsystemprocs..sysobjects, p=sybsystemprocs..sysprotects} 0 323

DEPENDENCIES
PROCS AND TABLES USED
writes table tempdb..#tmp_getcolumnprivileges (1) 
reads table sybsystemprocs..sysobjects  
read_writes table tempdb..#objects_id (1) 
reads table sybsystemprocs..sysprotects  
reads table sybsystemprocs..syscolumns  
calls proc sybsystemprocs..sp_getmessage  
   calls proc sybsystemprocs..sp_validlang  
      reads table master..syslanguages (1)  
   reads table sybsystemprocs..sysusermessages  
   reads table master..sysmessages (1)  
   reads table master..syslanguages (1)  
reads table sybsystemprocs..sysusers  
reads table master..spt_values (1)  
read_writes table tempdb..#tmp_grp_getcolumnprivileges (1) 
calls proc sybsystemprocs..sp_ijdbc_escapeliteralforlike