DatabaseProcApplicationCreatedLinks
sybsystemprocssp_drv_getcolumnprivileges  14 déc. 14Defects Propagation Dependencies

1     
2     /* Sccsid = '%Z% generic/sproc/src/%M% %I% %G%' */
3     
4     CREATE OR REPLACE PROCEDURE sp_drv_getcolumnprivileges(@table_name VARCHAR(771),
5         @table_owner VARCHAR(32) = NULL,
6         @table_qualifier VARCHAR(32) = NULL,
7         @column_name VARCHAR(771) = NULL)
8     
9     AS
10        /*Check if the table is a temporary table and we are in the temp db*/
11        IF (@table_name LIKE '#%' AND DB_NAME() != db_name(tempdb_id()))
12        BEGIN
13            /*17676, 'This may be a temporary object. Please execute procedure from your temporary database.'*/
14            RAISERROR 17676
15            RETURN (1)
16        END
17    
18        /*Check that the database of the table is the current database*/
19        IF (@table_qualifier IS NULL) OR (@table_qualifier = '')
20            SELECT @table_qualifier = DB_NAME()
21        ELSE
22        BEGIN
23            IF DB_NAME() != @table_qualifier
24            BEGIN
25                /*18039, 'Table qualifier must be name of current database.'*/
26                RAISERROR 18039
27                RETURN (1)
28            END
29        END
30    
31        IF (@table_owner IS NULL) OR (@table_owner = '')
32            SELECT @table_owner = '%'
33    
34        IF (@column_name IS NULL) OR (@column_name = '')
35            SELECT @column_name = '%'
36    
37        /* Adaptive Server has expanded all '*' elements in the following statement */ SELECT DISTINCT
38            TABLE_CAT,
39            TABLE_SCHEM,
40            TABLE_NAME,
41            COLUMN_NAME,
42            GRANTOR,
43            GRANTEE,
44            PRIVILEGE,
45            IS_GRANTABLE,
46            PREDICATE
47        FROM
48            --explicit grants/revokes
49            (SELECT
50                EXPLICITGRANTS.TABLE_CAT, EXPLICITGRANTS.TABLE_SCHEM, EXPLICITGRANTS.TABLE_NAME, EXPLICITGRANTS.COLUMN_NAME, EXPLICITGRANTS.GRANTOR, EXPLICITGRANTS.GRANTEE, EXPLICITGRANTS.PRIVILEGE, EXPLICITGRANTS.IS_GRANTABLE, EXPLICITGRANTS.PREDICATE
51            FROM
52                (SELECT
53                    DB_NAME() AS TABLE_CAT,
54                    matchinggrantrecords.table_owner AS TABLE_SCHEM,
55                    matchinggrantrecords.table_name AS TABLE_NAME,
56                    matchinggrantrecords.column_name AS COLUMN_NAME,
57                    matchinggrantrecords.grantor AS GRANTOR,
58                    posiblegrants.grantee AS GRANTEE,
59                    PRIVILEGE =
60                    CASE
61                        WHEN posiblegrants.action = 83 THEN 'IDENTITY INSERT'
62                        WHEN posiblegrants.action = 84 THEN 'IDENTITY UPDATE'
63                        WHEN posiblegrants.action = 151 THEN 'REFERENCES'
64                        WHEN posiblegrants.action = 193 THEN 'SELECT'
65                        WHEN posiblegrants.action = 195 THEN 'INSERT'
66                        WHEN posiblegrants.action = 196 THEN 'DELETE'
67                        WHEN posiblegrants.action = 197 THEN 'UPDATE'
68                        WHEN posiblegrants.action = 282 THEN 'DELETE STATISTICS'
69                        WHEN posiblegrants.action = 320 THEN 'TRUNCATE TABLE'
70                        WHEN posiblegrants.action = 326 THEN 'UPDATE STATISTICS'
71                        WHEN posiblegrants.action = 353 THEN 'DECRYPT'
72                        WHEN posiblegrants.action = 368 THEN 'TRANSFER TABLE'
73                        ELSE 'UNKNOWN'
74                    END,
75                    IS_GRANTABLE =
76                    CASE
77                        WHEN matchinggrantrecords.protecttype = 0 THEN 'YES'
78                        ELSE 'NO'
79                    END
80                    , dbo.sp_drv_getcomment(matchinggrantrecords.predid) AS PREDICATE
81                FROM
82                    (SELECT
83                        actions.action,
84                        dbo.sp_drv_anyprivilege(actions.action) AS any_action,
85                        userrecord.name AS grantee,
86                        userrecord.suid,
87                        userrecord.uid,
88                        userrecord.gid
89                    FROM
90                        --These are the only actions that are column specific with the exception of INSERT
91                        --INSERT is included because it is explicitly listed as a column permission in the ODBC spec
92                        --also it makes sense to make insert column specific.
93                        --You might not want someone messing with defaults like timestamps on a business transaction
94                        (SELECT 151 AS action
95                        UNION
96                        SELECT 193 AS action
97                        UNION
98                        SELECT 195 AS action
99                        UNION
100                       SELECT 197 AS action
101                       UNION
102                       SELECT 353 AS action) AS actions,
103                       (SELECT
104                           name,
105                           suid,
106                           uid,
107                           gid
108                       FROM
109                           sysusers
110                       WHERE
111                           suid > - 2) AS userrecord) AS posiblegrants
112                   INNER JOIN
113                       (SELECT
114                           tabletcolumns.table_id,
115                           USER_NAME(subprotects.grantorid) AS grantor,
116                           subprotects.granteeid,
117                           subprotects.protecttype,
118                           subprotects.action,
119                           subprotects.columns,
120                           subprotects.predid,
121                           tabletcolumns.table_owner,
122                           tabletcolumns.table_name,
123                           tabletcolumns.column_name,
124                           tabletcolumns.colid
125                       FROM
126                           (SELECT
127                               protects.id AS table_id,
128                               protects.grantor AS grantorid,
129                               protects.uid AS granteeid,
130                               protects.protecttype,
131                               protects.action,
132                               protects.predid,
133                               protects.columns
134                           FROM
135                               sysprotects AS protects
136                           WHERE
137                               protects.protecttype < 2) AS subprotects
138                           INNER JOIN
139                               (SELECT
140                                   objects.id AS table_id,
141                                   USER_NAME(objects.uid) AS table_owner,
142                                   objects.name AS table_name,
143                                   columns.name AS column_name,
144                                   columns.colid,
145                                   (columns.colid / 8) + 1 AS column_byte_index,
146                                   CONVERT(TINYINT, POWER(2, columns.colid % 8)) AS column_flag_index
147                               FROM
148                                   (SELECT
149                                       id,
150                                       uid,
151                                       name
152                                   FROM
153                                       sysobjects
154                                   WHERE
155                                       name LIKE @table_name ESCAPE '\' AND
156                                       USER_NAME(uid) LIKE @table_owner ESCAPE '\' AND
157                                       type IN ('S', 'U', 'V')) AS objects
158                                   INNER JOIN
159                                       (SELECT
160                                           name, colid, id
161                                       FROM
162                                           syscolumns
163                                       WHERE
164                                           name LIKE @column_name ESCAPE '\') AS columns
165                                       ON
166                                       objects.id = columns.id) AS tabletcolumns
167                               ON
168                               subprotects.table_id IN (tabletcolumns.table_id, 0) AND
169                               (subprotects.columns = 0x01 OR
170                                   subprotects.columns IS NULL OR
171                                   SUBSTRING(subprotects.columns, tabletcolumns.column_byte_index, 1) & tabletcolumns.column_flag_index != 0)) AS matchinggrantrecords
172                       ON
173                       matchinggrantrecords.action IN (posiblegrants.action, posiblegrants.any_action) AND
174                       (posiblegrants.uid = matchinggrantrecords.granteeid OR
175                           --uid NOT IN matching used records AND
176                           (NOT EXISTS (SELECT sysprotects.uid FROM (SELECT uid, id, columns, action FROM sysprotects) AS sysprotects LEFT JOIN (SELECT id, colid FROM syscolumns) AS syscolumns ON sysprotects.id IN (syscolumns.id, 0) AND (sysprotects.columns = 0x01 OR sysprotects.columns IS NULL OR SUBSTRING(sysprotects.columns, (syscolumns.colid / 8) + 1, 1) & CONVERT(TINYINT, POWER(2, syscolumns.colid % 8)) != 0) WHERE sysprotects.uid = posiblegrants.uid AND sysprotects.action IN (posiblegrants.action, posiblegrants.any_action) AND sysprotects.id IN (matchinggrantrecords.table_id, 0) AND syscolumns.colid = matchinggrantrecords.colid) AND
177                               --roleid IN matchinggrantrecords OR
178                               (matchinggrantrecords.granteeid IN (SELECT sysusers.uid FROM master.dbo.sysloginroles AS sysloginroles LEFT JOIN master.dbo.syssrvroles AS syssrvroles ON sysloginroles.srid = syssrvroles.srid LEFT JOIN sysusers ON syssrvroles.name = sysusers.name WHERE sysloginroles.suid = posiblegrants.suid) OR
179                                   --roleid NOT IN matching used records AND
180                                   (NOT EXISTS (SELECT rolelist.suid FROM (SELECT sysprotects.uid, sysprotects.action, sysprotects.id, syscolumns.colid FROM sysprotects LEFT JOIN syscolumns ON sysprotects.id IN (syscolumns.id, 0) AND (sysprotects.columns = 0x01 OR sysprotects.columns IS NULL OR SUBSTRING(sysprotects.columns, (syscolumns.colid / 8) + 1, 1) & CONVERT(TINYINT, POWER(2, syscolumns.colid % 8)) != 0)) AS usedlist INNER JOIN (SELECT sysusers.uid, sysloginroles.suid FROM master.dbo.sysloginroles AS sysloginroles LEFT JOIN master.dbo.syssrvroles AS syssrvroles ON sysloginroles.srid = syssrvroles.srid LEFT JOIN sysusers ON syssrvroles.name = sysusers.name) AS rolelist ON usedlist.uid = rolelist.uid WHERE usedlist.action IN (posiblegrants.action, posiblegrants.any_action) AND usedlist.id IN (matchinggrantrecords.table_id, 0) AND rolelist.suid = posiblegrants.suid AND usedlist.colid = matchinggrantrecords.colid) AND
181                                       --gid IN matchinggrantrecords OR
182                                       (posiblegrants.gid = matchinggrantrecords.granteeid OR
183                                           --gid NOT IN matching used records AND
184                                           (NOT EXISTS (SELECT sysprotects.uid FROM (SELECT uid, id, columns, action FROM sysprotects) AS sysprotects LEFT JOIN (SELECT id, colid FROM syscolumns) AS syscolumns ON sysprotects.id IN (syscolumns.id, 0) AND (sysprotects.columns = 0x01 OR sysprotects.columns IS NULL OR SUBSTRING(sysprotects.columns, (syscolumns.colid / 8) + 1, 1) & CONVERT(TINYINT, POWER(2, syscolumns.colid % 8)) != 0) WHERE sysprotects.uid = posiblegrants.gid AND sysprotects.action IN (posiblegrants.action, posiblegrants.any_action) AND sysprotects.id IN (matchinggrantrecords.table_id, 0) AND syscolumns.colid = matchinggrantrecords.colid) AND
185                                               --public in matchinggrantrecords
186                                               0 = matchinggrantrecords.granteeid))))))) AS EXPLICITGRANTS
187           UNION
188           --implicit grants
189           SELECT
190               IMPLICITGRANTS.TABLE_CAT, IMPLICITGRANTS.TABLE_SCHEM, IMPLICITGRANTS.TABLE_NAME, IMPLICITGRANTS.COLUMN_NAME, IMPLICITGRANTS.GRANTOR, IMPLICITGRANTS.GRANTEE, IMPLICITGRANTS.PRIVILEGE, IMPLICITGRANTS.IS_GRANTABLE, IMPLICITGRANTS.PREDICATE
191           FROM
192               (SELECT
193                   DB_NAME() AS TABLE_CAT,
194                   tabletcolumns.table_owner AS TABLE_SCHEM,
195                   tabletcolumns.table_name AS TABLE_NAME,
196                   tabletcolumns.column_name AS COLUMN_NAME,
197                   '_SYSTEM' AS GRANTOR,
198                   posiblegrants.grantee AS GRANTEE,
199                   PRIVILEGE =
200                   CASE
201                       WHEN posiblegrants.action = 83 THEN 'IDENTITY INSERT'
202                       WHEN posiblegrants.action = 84 THEN 'IDENTITY UPDATE'
203                       WHEN posiblegrants.action = 151 THEN 'REFERENCES'
204                       WHEN posiblegrants.action = 193 THEN 'SELECT'
205                       WHEN posiblegrants.action = 195 THEN 'INSERT'
206                       WHEN posiblegrants.action = 196 THEN 'DELETE'
207                       WHEN posiblegrants.action = 197 THEN 'UPDATE'
208                       WHEN posiblegrants.action = 282 THEN 'DELETE STATISTICS'
209                       WHEN posiblegrants.action = 320 THEN 'TRUNCATE TABLE'
210                       WHEN posiblegrants.action = 326 THEN 'UPDATE STATISTICS'
211                       WHEN posiblegrants.action = 353 THEN 'DECRYPT'
212                       WHEN posiblegrants.action = 368 THEN 'TRANSFER TABLE'
213                       ELSE 'UNKNOWN'
214                   END,
215                   'YES' AS IS_GRANTABLE
216                   , CONVERT(VARCHAR(255), NULL) AS PREDICATE
217               FROM
218                   (SELECT
219                       actions.action,
220                       dbo.sp_drv_anyprivilege(actions.action) AS any_action,
221                       userrecord.name AS grantee,
222                       userrecord.suid,
223                       userrecord.uid,
224                       userrecord.gid
225                   FROM
226                       --These are the only actions that are column specific with the exception of INSERT
227                       --INSERT is included because it is explicitly listed as a column permission in the ODBC spec
228                       --also it makes sense to make insert column specific.
229                       --You might not want someone messing with defaults like timestamps on a business transaction
230                       (SELECT 151 AS action
231                       UNION
232                       SELECT 193 AS action
233                       UNION
234                       SELECT 195 AS action
235                       UNION
236                       SELECT 197 AS action
237                       UNION
238                       SELECT 353 AS action) AS actions,
239                       (SELECT
240                           name,
241                           suid,
242                           uid,
243                           gid
244                       FROM
245                           sysusers
246                       WHERE
247                           suid > - 2) AS userrecord) AS posiblegrants
248                   INNER JOIN
249                       (SELECT
250                           objects.id AS table_id,
251                           objects.uid AS table_ownerid,
252                           USER_NAME(objects.uid) AS table_owner,
253                           objects.name AS table_name,
254                           columns.name AS column_name,
255                           columns.colid
256                       FROM
257                           sysobjects AS objects
258                           INNER JOIN
259                               syscolumns AS columns
260                               ON
261                               objects.id = columns.id
262                       WHERE
263                           objects.name LIKE @table_name ESCAPE '\' AND
264                           USER_NAME(objects.uid) LIKE @table_owner ESCAPE '\' AND
265                           columns.name LIKE @column_name ESCAPE '\' AND
266                           objects.type IN ('S', 'U', 'V')) AS tabletcolumns
267                       ON
268                       posiblegrants.uid = tabletcolumns.table_ownerid AND
269                       --(the action is not decrypt OR implicit decrypt is enabled) AND
270                       (posiblegrants.action != 353 OR (SELECT value FROM master.dbo.sysconfigures WHERE config = 480) = 0) AND
271                       --uid NOT IN matching used records AND
272                       NOT EXISTS (SELECT sysprotects.uid FROM (SELECT uid, id, columns, action FROM sysprotects) AS sysprotects LEFT JOIN (SELECT id, colid FROM syscolumns) AS syscolumns ON sysprotects.id IN (syscolumns.id, 0) AND (sysprotects.columns = 0x01 OR sysprotects.columns IS NULL OR SUBSTRING(sysprotects.columns, (syscolumns.colid / 8) + 1, 1) & CONVERT(TINYINT, POWER(2, syscolumns.colid % 8)) != 0) WHERE sysprotects.uid = posiblegrants.uid AND sysprotects.action IN (posiblegrants.action, posiblegrants.any_action) AND sysprotects.id IN (tabletcolumns.table_id, 0) AND syscolumns.colid = tabletcolumns.colid) AND
273                       --roleid NOT IN matching used records AND
274                       NOT EXISTS (SELECT rolelist.suid FROM (SELECT sysprotects.uid, sysprotects.action, sysprotects.id, syscolumns.colid FROM sysprotects LEFT JOIN syscolumns ON sysprotects.id IN (syscolumns.id, 0) AND (sysprotects.columns = 0x01 OR sysprotects.columns IS NULL OR SUBSTRING(sysprotects.columns, (syscolumns.colid / 8) + 1, 1) & CONVERT(TINYINT, POWER(2, syscolumns.colid % 8)) != 0)) AS usedlist INNER JOIN (SELECT sysusers.uid, sysloginroles.suid FROM master.dbo.sysloginroles AS sysloginroles LEFT JOIN master.dbo.syssrvroles AS syssrvroles ON sysloginroles.srid = syssrvroles.srid LEFT JOIN sysusers ON syssrvroles.name = sysusers.name) AS rolelist ON usedlist.uid = rolelist.uid WHERE usedlist.action IN (posiblegrants.action, posiblegrants.any_action) AND usedlist.id IN (tabletcolumns.table_id, 0) AND rolelist.suid = posiblegrants.suid AND usedlist.colid = tabletcolumns.colid) AND
275                       --gid NOT IN matching used records AND
276                       NOT EXISTS (SELECT sysprotects.uid FROM (SELECT uid, id, columns, action FROM sysprotects) AS sysprotects LEFT JOIN (SELECT id, colid FROM syscolumns) AS syscolumns ON sysprotects.id IN (syscolumns.id, 0) AND (sysprotects.columns = 0x01 OR sysprotects.columns IS NULL OR SUBSTRING(sysprotects.columns, (syscolumns.colid / 8) + 1, 1) & CONVERT(TINYINT, POWER(2, syscolumns.colid % 8)) != 0) WHERE sysprotects.uid = posiblegrants.gid AND sysprotects.action IN (posiblegrants.action, posiblegrants.any_action) AND sysprotects.id IN (tabletcolumns.table_id, 0) AND syscolumns.colid = tabletcolumns.colid) AND
277                       --public NOT IN matchinggrantrecords
278                       NOT EXISTS (SELECT sysprotects.uid FROM (SELECT uid, id, columns, action FROM sysprotects WHERE uid = 0) AS sysprotects LEFT JOIN (SELECT id, colid FROM syscolumns) AS syscolumns ON sysprotects.id IN (syscolumns.id, 0) AND (sysprotects.columns = 0x01 OR sysprotects.columns IS NULL OR SUBSTRING(sysprotects.columns, (syscolumns.colid / 8) + 1, 1) & CONVERT(TINYINT, POWER(2, syscolumns.colid % 8)) != 0) WHERE sysprotects.action IN (posiblegrants.action, posiblegrants.any_action) AND sysprotects.id IN (tabletcolumns.table_id, 0) AND syscolumns.colid = tabletcolumns.colid)) AS IMPLICITGRANTS) AS COLUMNPRIVILEGES
279       ORDER BY
280           TABLE_CAT,
281           TABLE_SCHEM,
282           TABLE_NAME,
283           COLUMN_NAME,
284           PRIVILEGE,
285           GRANTEE
286   
287       RETURN (0)
288   


exec sp_procxmode 'sp_drv_getcolumnprivileges', 'AnyMode'
go

Grant Execute on sp_drv_getcolumnprivileges to public
go
RESULT SETS
sp_drv_getcolumnprivileges_rset_001

DEFECTS
 QCAR 6 Cartesian product between tables tempdb..actions_D1 actions and [tempdb..userrecord_D2 userrecord] 89
 QCAR 6 Cartesian product between tables tempdb..actions_D16 actions and [tempdb..userrecord_D17 userrecord] 225
 QJWI 5 Join or Sarg Without Index 164
 QJWI 5 Join or Sarg Without Index 166
 QJWI 5 Join or Sarg Without Index 168
 QJWI 5 Join or Sarg Without Index 173
 QJWI 5 Join or Sarg Without Index 176
 QJWI 5 Join or Sarg Without Index 178
 QJWI 5 Join or Sarg Without Index 180
 QJWI 5 Join or Sarg Without Index 184
 QJWI 5 Join or Sarg Without Index 268
 QJWI 5 Join or Sarg Without Index 272
 QJWI 5 Join or Sarg Without Index 274
 QJWI 5 Join or Sarg Without Index 276
 QJWI 5 Join or Sarg Without Index 278
 MEST 4 Empty String will be replaced by Single Space 19
 MEST 4 Empty String will be replaced by Single Space 31
 MEST 4 Empty String will be replaced by Single Space 34
 MINU 4 Unique Index with nullable columns master..sysconfigures master..sysconfigures
 MINU 4 Unique Index with nullable columns sybsystemprocs..sysprotects sybsystemprocs..sysprotects
 QPUI 4 Join or Sarg with Un-Rooted Partial Index Use SARG Candidate index: sysprotects.csysprotects unique clustered
(id, action, grantor, uid, protecttype, predid)
Intersection: {protecttype}
137
 QPUI 4 Join or Sarg with Un-Rooted Partial Index Use SARG Candidate index: sysprotects.csysprotects unique clustered
(id, action, grantor, uid, protecttype, predid)
Intersection: {uid}
278
 QTYP 4 Comparison type mismatch Comparison type mismatch: tinyint vs int 77
 QTYP 4 Comparison type mismatch Comparison type mismatch: tinyint vs int 137
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 270
 TNOI 4 Table with no index tempdb..COLUMNPRIVILEGES_D29 tempdb..COLUMNPRIVILEGES_D29
 TNOI 4 Table with no index tempdb..EXPLICITGRANTS_D15 tempdb..EXPLICITGRANTS_D15
 TNOI 4 Table with no index tempdb..IMPLICITGRANTS_D28 tempdb..IMPLICITGRANTS_D28
 TNOI 4 Table with no index tempdb..actions_D1 tempdb..actions_D1
 TNOI 4 Table with no index tempdb..actions_D16 tempdb..actions_D16
 TNOI 4 Table with no index tempdb..columns_D6 tempdb..columns_D6
 TNOI 4 Table with no index tempdb..matchinggrantrecords_D8 tempdb..matchinggrantrecords_D8
 TNOI 4 Table with no index tempdb..objects_D5 tempdb..objects_D5
 TNOI 4 Table with no index tempdb..posiblegrants_D18 tempdb..posiblegrants_D18
 TNOI 4 Table with no index tempdb..posiblegrants_D3 tempdb..posiblegrants_D3
 TNOI 4 Table with no index tempdb..rolelist_D12 tempdb..rolelist_D12
 TNOI 4 Table with no index tempdb..rolelist_D23 tempdb..rolelist_D23
 TNOI 4 Table with no index tempdb..subprotects_D4 tempdb..subprotects_D4
 TNOI 4 Table with no index tempdb..syscolumns_D10 tempdb..syscolumns_D10
 TNOI 4 Table with no index tempdb..syscolumns_D14 tempdb..syscolumns_D14
 TNOI 4 Table with no index tempdb..syscolumns_D21 tempdb..syscolumns_D21
 TNOI 4 Table with no index tempdb..syscolumns_D25 tempdb..syscolumns_D25
 TNOI 4 Table with no index tempdb..syscolumns_D27 tempdb..syscolumns_D27
 TNOI 4 Table with no index tempdb..sysprotects_D13 tempdb..sysprotects_D13
 TNOI 4 Table with no index tempdb..sysprotects_D20 tempdb..sysprotects_D20
 TNOI 4 Table with no index tempdb..sysprotects_D24 tempdb..sysprotects_D24
 TNOI 4 Table with no index tempdb..sysprotects_D26 tempdb..sysprotects_D26
 TNOI 4 Table with no index tempdb..sysprotects_D9 tempdb..sysprotects_D9
 TNOI 4 Table with no index tempdb..tabletcolumns_D19 tempdb..tabletcolumns_D19
 TNOI 4 Table with no index tempdb..tabletcolumns_D7 tempdb..tabletcolumns_D7
 TNOI 4 Table with no index tempdb..usedlist_D11 tempdb..usedlist_D11
 TNOI 4 Table with no index tempdb..usedlist_D22 tempdb..usedlist_D22
 TNOI 4 Table with no index tempdb..userrecord_D17 tempdb..userrecord_D17
 TNOI 4 Table with no index tempdb..userrecord_D2 tempdb..userrecord_D2
 TNOU 4 Table with no unique index master..sysloginroles master..sysloginroles
 MAW1 3 Warning message on %name% sybsystemprocs..sysprotects.id: Warning message on sysprotects 127
 MAW1 3 Warning message on %name% tempdb..objects_D5.id: Warning message on objects_D5 140
 MAW1 3 Warning message on %name% sybsystemprocs..sysobjects.id: Warning message on sysobjects 149
 MAW1 3 Warning message on %name% sybsystemprocs..syscolumns.id: Warning message on syscolumns 160
 MAW1 3 Warning message on %name% tempdb..columns_D6.id: Warning message on columns_D6 166
 MAW1 3 Warning message on %name% tempdb..objects_D5.id: Warning message on objects_D5 166
 MAW1 3 Warning message on %name% sybsystemprocs..syscolumns.id: Warning message on syscolumns 176
 MAW1 3 Warning message on %name% sybsystemprocs..sysprotects.id: Warning message on sysprotects 176
 MAW1 3 Warning message on %name% tempdb..syscolumns_D10.id: Warning message on syscolumns_D10 176
 MAW1 3 Warning message on %name% tempdb..sysprotects_D9.id: Warning message on sysprotects_D9 176
 MAW1 3 Warning message on %name% sybsystemprocs..syscolumns.id: Warning message on syscolumns 180
 MAW1 3 Warning message on %name% sybsystemprocs..sysprotects.id: Warning message on sysprotects 180
 MAW1 3 Warning message on %name% tempdb..usedlist_D11.id: Warning message on usedlist_D11 180
 MAW1 3 Warning message on %name% sybsystemprocs..syscolumns.id: Warning message on syscolumns 184
 MAW1 3 Warning message on %name% sybsystemprocs..sysprotects.id: Warning message on sysprotects 184
 MAW1 3 Warning message on %name% tempdb..syscolumns_D14.id: Warning message on syscolumns_D14 184
 MAW1 3 Warning message on %name% tempdb..sysprotects_D13.id: Warning message on sysprotects_D13 184
 MAW1 3 Warning message on %name% sybsystemprocs..sysobjects.id: Warning message on sysobjects 250
 MAW1 3 Warning message on %name% sybsystemprocs..syscolumns.id: Warning message on syscolumns 261
 MAW1 3 Warning message on %name% sybsystemprocs..sysobjects.id: Warning message on sysobjects 261
 MAW1 3 Warning message on %name% sybsystemprocs..syscolumns.id: Warning message on syscolumns 272
 MAW1 3 Warning message on %name% sybsystemprocs..sysprotects.id: Warning message on sysprotects 272
 MAW1 3 Warning message on %name% tempdb..syscolumns_D21.id: Warning message on syscolumns_D21 272
 MAW1 3 Warning message on %name% tempdb..sysprotects_D20.id: Warning message on sysprotects_D20 272
 MAW1 3 Warning message on %name% sybsystemprocs..syscolumns.id: Warning message on syscolumns 274
 MAW1 3 Warning message on %name% sybsystemprocs..sysprotects.id: Warning message on sysprotects 274
 MAW1 3 Warning message on %name% tempdb..usedlist_D22.id: Warning message on usedlist_D22 274
 MAW1 3 Warning message on %name% sybsystemprocs..syscolumns.id: Warning message on syscolumns 276
 MAW1 3 Warning message on %name% sybsystemprocs..sysprotects.id: Warning message on sysprotects 276
 MAW1 3 Warning message on %name% tempdb..syscolumns_D25.id: Warning message on syscolumns_D25 276
 MAW1 3 Warning message on %name% tempdb..sysprotects_D24.id: Warning message on sysprotects_D24 276
 MAW1 3 Warning message on %name% sybsystemprocs..syscolumns.id: Warning message on syscolumns 278
 MAW1 3 Warning message on %name% sybsystemprocs..sysprotects.id: Warning message on sysprotects 278
 MAW1 3 Warning message on %name% tempdb..syscolumns_D27.id: Warning message on syscolumns_D27 278
 MAW1 3 Warning message on %name% tempdb..sysprotects_D26.id: Warning message on sysprotects_D26 278
 MBLI 3 Integer Value of Binary Literal is Platform Dependant 169
 MBLI 3 Integer Value of Binary Literal is Platform Dependant 176
 MBLI 3 Integer Value of Binary Literal is Platform Dependant 180
 MBLI 3 Integer Value of Binary Literal is Platform Dependant 184
 MBLI 3 Integer Value of Binary Literal is Platform Dependant 272
 MBLI 3 Integer Value of Binary Literal is Platform Dependant 274
 MBLI 3 Integer Value of Binary Literal is Platform Dependant 276
 MBLI 3 Integer Value of Binary Literal is Platform Dependant 278
 MGTP 3 Grant to public master..sysconfigures  
 MGTP 3 Grant to public master..sysloginroles  
 MGTP 3 Grant to public master..syssrvroles  
 MGTP 3 Grant to public sybsystemprocs..sp_drv_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  
 MUCO 3 Useless Code Useless Brackets in create proc 4
 MUCO 3 Useless Code Useless Brackets 11
 MUCO 3 Useless Code Useless Brackets 15
 MUCO 3 Useless Code Useless Brackets 27
 MUCO 3 Useless Code Useless Brackets 145
 MUCO 3 Useless Code Useless Brackets 176
 MUCO 3 Useless Code Useless Brackets 180
 MUCO 3 Useless Code Useless Brackets 184
 MUCO 3 Useless Code Useless Brackets 272
 MUCO 3 Useless Code Useless Brackets 274
 MUCO 3 Useless Code Useless Brackets 276
 MUCO 3 Useless Code Useless Brackets 278
 MUCO 3 Useless Code Useless Brackets 287
 QGWO 3 Group by/Distinct/Union without order by 49
 QGWO 3 Group by/Distinct/Union without order by 94
 QGWO 3 Group by/Distinct/Union without order by 230
 QNUA 3 Should use Alias: Table sybsystemprocs..sysusers 178
 QNUA 3 Should use Alias: Table sybsystemprocs..syscolumns 180
 QNUA 3 Should use Alias: Table sybsystemprocs..sysprotects 180
 QNUA 3 Should use Alias: Table sybsystemprocs..sysusers 180
 QNUA 3 Should use Alias: Table master..sysconfigures 270
 QNUA 3 Should use Alias: Table sybsystemprocs..syscolumns 274
 QNUA 3 Should use Alias: Table sybsystemprocs..sysprotects 274
 QNUA 3 Should use Alias: Table sybsystemprocs..sysusers 274
 QPNC 3 No column in condition 270
 QUNI 3 Check Use of 'union' vs 'union all' 49
 QUNI 3 Check Use of 'union' vs 'union all' 94
 QUNI 3 Check Use of 'union' vs 'union all' 230
 MDRV 2 Derived Table Marker 49
 MDRV 2 Derived Table Marker 52
 MDRV 2 Derived Table Marker 82
 MDRV 2 Derived Table Marker 94
 MDRV 2 Derived Table Marker 103
 MDRV 2 Derived Table Marker 113
 MDRV 2 Derived Table Marker 126
 MDRV 2 Derived Table Marker 139
 MDRV 2 Derived Table Marker 148
 MDRV 2 Derived Table Marker 159
 MDRV 2 Derived Table Marker 176
 MDRV 2 Derived Table Marker 180
 MDRV 2 Derived Table Marker 184
 MDRV 2 Derived Table Marker 192
 MDRV 2 Derived Table Marker 218
 MDRV 2 Derived Table Marker 230
 MDRV 2 Derived Table Marker 239
 MDRV 2 Derived Table Marker 249
 MDRV 2 Derived Table Marker 272
 MDRV 2 Derived Table Marker 274
 MDRV 2 Derived Table Marker 276
 MDRV 2 Derived Table Marker 278
 MRST 2 Result Set Marker 37
 MSUB 2 Subquery Marker 270
 MSUC 2 Correlated Subquery Marker 176
 MSUC 2 Correlated Subquery Marker 178
 MSUC 2 Correlated Subquery Marker 180
 MSUC 2 Correlated Subquery Marker 184
 MSUC 2 Correlated Subquery Marker 272
 MSUC 2 Correlated Subquery Marker 274
 MSUC 2 Correlated Subquery Marker 276
 MSUC 2 Correlated Subquery Marker 278
 MTR1 2 Metrics: Comments Ratio Comments: 8% 4
 MTR2 2 Metrics: Cyclomatic Complexity Cyclo: 9 = 10dec - 3exi + 2 4
 MTR3 2 Metrics: Query Complexity Complexity: 214 4
 PRED_QUERY_COLLECTION 2 {cd6=tempdb..columns_D6, od5=tempdb..objects_D5} 0 139
 PRED_QUERY_COLLECTION 2 {cd6=tempdb..columns_D6, od5=tempdb..objects_D5} 0 139
 PRED_QUERY_COLLECTION 2 {cd6=tempdb..columns_D6, od5=tempdb..objects_D5} 0 139
 PRED_QUERY_COLLECTION 2 {cd6=tempdb..columns_D6, od5=tempdb..objects_D5} 0 139
 PRED_QUERY_COLLECTION 2 {cd6=tempdb..columns_D6, od5=tempdb..objects_D5} 0 139
 PRED_QUERY_COLLECTION 2 {l=master..sysloginroles, pd3=tempdb..posiblegrants_D3, s=master..syssrvroles, u=sybsystemprocs..sysusers} 0 178
 PRED_QUERY_COLLECTION 2 {l=master..sysloginroles, pd3=tempdb..posiblegrants_D3, s=master..syssrvroles, u=sybsystemprocs..sysusers} 0 178
 PRED_QUERY_COLLECTION 2 {l=master..sysloginroles, pd3=tempdb..posiblegrants_D3, s=master..syssrvroles, u=sybsystemprocs..sysusers} 0 178
 PRED_QUERY_COLLECTION 2 {l=master..sysloginroles, s=master..syssrvroles, u=sybsystemprocs..sysusers} 0 180
 PRED_QUERY_COLLECTION 2 {l=master..sysloginroles, s=master..syssrvroles, u=sybsystemprocs..sysusers} 0 180
 PRED_QUERY_COLLECTION 2 {l=master..sysloginroles, s=master..syssrvroles, u=sybsystemprocs..sysusers} 0 180
 PRED_QUERY_COLLECTION 2 {l=master..sysloginroles, s=master..syssrvroles, u=sybsystemprocs..sysusers} 0 180
 PRED_QUERY_COLLECTION 2 {pd18=tempdb..posiblegrants_D18, td19=tempdb..tabletcolumns_D19} 0 192
 PRED_QUERY_COLLECTION 2 {pd18=tempdb..posiblegrants_D18, td19=tempdb..tabletcolumns_D19} 0 192
 PRED_QUERY_COLLECTION 2 {pd18=tempdb..posiblegrants_D18, td19=tempdb..tabletcolumns_D19} 0 192
 PRED_QUERY_COLLECTION 2 {c=sybsystemprocs..syscolumns, o=sybsystemprocs..sysobjects} 0 249
 PRED_QUERY_COLLECTION 2 {c=sybsystemprocs..syscolumns, o=sybsystemprocs..sysobjects} 0 249
 PRED_QUERY_COLLECTION 2 {c=sybsystemprocs..syscolumns, o=sybsystemprocs..sysobjects} 0 249
 PRED_QUERY_COLLECTION 2 {c=sybsystemprocs..syscolumns, o=sybsystemprocs..sysobjects} 0 249
 PRED_QUERY_COLLECTION 2 {l=master..sysloginroles, s=master..syssrvroles, u=sybsystemprocs..sysusers} 0 274
 PRED_QUERY_COLLECTION 2 {l=master..sysloginroles, s=master..syssrvroles, u=sybsystemprocs..sysusers} 0 274
 PRED_QUERY_COLLECTION 2 {l=master..sysloginroles, s=master..syssrvroles, u=sybsystemprocs..sysusers} 0 274
 PRED_QUERY_COLLECTION 2 {l=master..sysloginroles, s=master..syssrvroles, u=sybsystemprocs..sysusers} 0 274

DEPENDENCIES
PROCS AND TABLES USED
reads table sybsystemprocs..sysobjects  
reads table sybsystemprocs..sysprotects  
reads table master..sysloginroles (1)  
reads table master..syssrvroles (1)  
reads table sybsystemprocs..syscolumns  
reads table master..sysconfigures (1)  
writes table sybsystemprocs..sp_drv_getcolumnprivileges_rset_001 
reads table sybsystemprocs..sysusers  

CALLERS
called by proc sybsystemprocs..sp_odbc_getcolumnprivileges  
called by proc sybsystemprocs..sp_jdbc_getcolumnprivileges