DatabaseProcApplicationCreatedLinks
sybsystemprocssp_drv_gettableprivileges  14 déc. 14Defects Propagation Dependencies

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


exec sp_procxmode 'sp_drv_gettableprivileges', 'AnyMode'
go

Grant Execute on sp_drv_gettableprivileges to public
go
RESULT SETS
sp_drv_gettableprivileges_rset_001

DEFECTS
 QCAR 6 Cartesian product between tables tempdb..actions_D1 actions and [tempdb..userrecord_D2 userrecord] 85
 QCAR 6 Cartesian product between tables tempdb..actions_D12 actions and [tempdb..userrecord_D13 userrecord] 207
 QJWI 5 Join or Sarg Without Index 154
 QJWI 5 Join or Sarg Without Index 156
 QJWI 5 Join or Sarg Without Index 159
 QJWI 5 Join or Sarg Without Index 161
 QJWI 5 Join or Sarg Without Index 163
 QJWI 5 Join or Sarg Without Index 167
 QJWI 5 Join or Sarg Without Index 253
 QJWI 5 Join or Sarg Without Index 257
 QJWI 5 Join or Sarg Without Index 259
 QJWI 5 Join or Sarg Without Index 261
 QJWI 5 Join or Sarg Without Index 263
 MEST 4 Empty String will be replaced by Single Space 18
 MEST 4 Empty String will be replaced by Single Space 30
 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}
141
 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}
263
 QTYP 4 Comparison type mismatch Comparison type mismatch: tinyint vs int 71
 QTYP 4 Comparison type mismatch Comparison type mismatch: tinyint vs int 141
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 255
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 259
 TNOI 4 Table with no index tempdb..EXPLICITGRANTS_D11 tempdb..EXPLICITGRANTS_D11
 TNOI 4 Table with no index tempdb..IMPLICITGRANTS_D18 tempdb..IMPLICITGRANTS_D18
 TNOI 4 Table with no index tempdb..TABLEPRIVILEGES_D19 tempdb..TABLEPRIVILEGES_D19
 TNOI 4 Table with no index tempdb..actions_D1 tempdb..actions_D1
 TNOI 4 Table with no index tempdb..actions_D12 tempdb..actions_D12
 TNOI 4 Table with no index tempdb..matchinggrantrecords_D6 tempdb..matchinggrantrecords_D6
 TNOI 4 Table with no index tempdb..posiblegrants_D14 tempdb..posiblegrants_D14
 TNOI 4 Table with no index tempdb..posiblegrants_D3 tempdb..posiblegrants_D3
 TNOI 4 Table with no index tempdb..rolelist_D10 tempdb..rolelist_D10
 TNOI 4 Table with no index tempdb..rolelist_D17 tempdb..rolelist_D17
 TNOI 4 Table with no index tempdb..subprotects_D4 tempdb..subprotects_D4
 TNOI 4 Table with no index tempdb..sysloginroles_D7 tempdb..sysloginroles_D7
 TNOI 4 Table with no index tempdb..syssrvroles_D8 tempdb..syssrvroles_D8
 TNOI 4 Table with no index tempdb..tablets_D15 tempdb..tablets_D15
 TNOI 4 Table with no index tempdb..tablets_D5 tempdb..tablets_D5
 TNOI 4 Table with no index tempdb..usedlist_D16 tempdb..usedlist_D16
 TNOI 4 Table with no index tempdb..usedlist_D9 tempdb..usedlist_D9
 TNOI 4 Table with no index tempdb..userrecord_D13 tempdb..userrecord_D13
 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 131
 MAW1 3 Warning message on %name% sybsystemprocs..sysobjects.id: Warning message on sysobjects 144
 MAW1 3 Warning message on %name% sybsystemprocs..sysprotects.id: Warning message on sysprotects 159
 MAW1 3 Warning message on %name% sybsystemprocs..sysprotects.id: Warning message on sysprotects 163
 MAW1 3 Warning message on %name% tempdb..usedlist_D9.id: Warning message on usedlist_D9 163
 MAW1 3 Warning message on %name% sybsystemprocs..sysprotects.id: Warning message on sysprotects 167
 MAW1 3 Warning message on %name% sybsystemprocs..sysobjects.id: Warning message on sysobjects 242
 MAW1 3 Warning message on %name% sybsystemprocs..sysprotects.id: Warning message on sysprotects 257
 MAW1 3 Warning message on %name% sybsystemprocs..sysprotects.id: Warning message on sysprotects 259
 MAW1 3 Warning message on %name% tempdb..usedlist_D16.id: Warning message on usedlist_D16 259
 MAW1 3 Warning message on %name% sybsystemprocs..sysprotects.id: Warning message on sysprotects 261
 MAW1 3 Warning message on %name% sybsystemprocs..sysprotects.id: Warning message on sysprotects 263
 MBLI 3 Integer Value of Binary Literal is Platform Dependant 73
 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_gettableprivileges  
 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 9
 MUCO 3 Useless Code Useless Brackets 13
 MUCO 3 Useless Code Useless Brackets 26
 MUCO 3 Useless Code Useless Brackets 271
 QGWO 3 Group by/Distinct/Union without order by 44
 QGWO 3 Group by/Distinct/Union without order by 86
 QGWO 3 Group by/Distinct/Union without order by 208
 QNUA 3 Should use Alias: Table sybsystemprocs..sysprotects 159
 QNUA 3 Should use Alias: Table sybsystemprocs..sysusers 161
 QNUA 3 Should use Alias: Table sybsystemprocs..sysusers 163
 QNUA 3 Should use Alias: Table sybsystemprocs..sysprotects 167
 QNUA 3 Should use Alias: Table master..sysconfigures 255
 QNUA 3 Should use Alias: Table sybsystemprocs..sysprotects 257
 QNUA 3 Should use Alias: Table sybsystemprocs..sysusers 259
 QNUA 3 Should use Alias: Table sybsystemprocs..sysprotects 261
 QNUA 3 Should use Alias: Table sybsystemprocs..sysprotects 263
 QPNC 3 No column in condition 255
 QUNI 3 Check Use of 'union' vs 'union all' 44
 QUNI 3 Check Use of 'union' vs 'union all' 86
 QUNI 3 Check Use of 'union' vs 'union all' 208
 MDRV 2 Derived Table Marker 44
 MDRV 2 Derived Table Marker 47
 MDRV 2 Derived Table Marker 78
 MDRV 2 Derived Table Marker 86
 MDRV 2 Derived Table Marker 109
 MDRV 2 Derived Table Marker 119
 MDRV 2 Derived Table Marker 130
 MDRV 2 Derived Table Marker 143
 MDRV 2 Derived Table Marker 161
 MDRV 2 Derived Table Marker 163
 MDRV 2 Derived Table Marker 175
 MDRV 2 Derived Table Marker 200
 MDRV 2 Derived Table Marker 208
 MDRV 2 Derived Table Marker 231
 MDRV 2 Derived Table Marker 241
 MDRV 2 Derived Table Marker 259
 MRST 2 Result Set Marker 33
 MSUB 2 Subquery Marker 255
 MSUC 2 Correlated Subquery Marker 159
 MSUC 2 Correlated Subquery Marker 161
 MSUC 2 Correlated Subquery Marker 163
 MSUC 2 Correlated Subquery Marker 167
 MSUC 2 Correlated Subquery Marker 257
 MSUC 2 Correlated Subquery Marker 259
 MSUC 2 Correlated Subquery Marker 261
 MSUC 2 Correlated Subquery Marker 263
 MTR1 2 Metrics: Comments Ratio Comments: 6% 4
 MTR2 2 Metrics: Cyclomatic Complexity Cyclo: 7 = 8dec - 3exi + 2 4
 MTR3 2 Metrics: Query Complexity Complexity: 149 4
 PRED_QUERY_COLLECTION 2 {md6=tempdb..matchinggrantrecords_D6, pd3=tempdb..posiblegrants_D3} 0 47
 PRED_QUERY_COLLECTION 2 {md6=tempdb..matchinggrantrecords_D6, pd3=tempdb..posiblegrants_D3} 0 47
 PRED_QUERY_COLLECTION 2 {md6=tempdb..matchinggrantrecords_D6, pd3=tempdb..posiblegrants_D3} 0 47
 PRED_QUERY_COLLECTION 2 {ld7=tempdb..sysloginroles_D7, md6=tempdb..matchinggrantrecords_D6, pd3=tempdb..posiblegrants_D3, sd8=tempdb..syssrvroles_D8, u=sybsystemprocs..sysusers} 0 161
 PRED_QUERY_COLLECTION 2 {ld7=tempdb..sysloginroles_D7, md6=tempdb..matchinggrantrecords_D6, pd3=tempdb..posiblegrants_D3, sd8=tempdb..syssrvroles_D8, u=sybsystemprocs..sysusers} 0 161
 PRED_QUERY_COLLECTION 2 {ld7=tempdb..sysloginroles_D7, md6=tempdb..matchinggrantrecords_D6, pd3=tempdb..posiblegrants_D3, sd8=tempdb..syssrvroles_D8, u=sybsystemprocs..sysusers} 0 161
 PRED_QUERY_COLLECTION 2 {l=master..sysloginroles, s=master..syssrvroles, u=sybsystemprocs..sysusers} 0 163
 PRED_QUERY_COLLECTION 2 {l=master..sysloginroles, s=master..syssrvroles, u=sybsystemprocs..sysusers} 0 163
 PRED_QUERY_COLLECTION 2 {l=master..sysloginroles, s=master..syssrvroles, u=sybsystemprocs..sysusers} 0 163
 PRED_QUERY_COLLECTION 2 {l=master..sysloginroles, s=master..syssrvroles, u=sybsystemprocs..sysusers} 0 163
 PRED_QUERY_COLLECTION 2 {pd14=tempdb..posiblegrants_D14, td15=tempdb..tablets_D15} 0 175
 PRED_QUERY_COLLECTION 2 {pd14=tempdb..posiblegrants_D14, td15=tempdb..tablets_D15} 0 175
 PRED_QUERY_COLLECTION 2 {pd14=tempdb..posiblegrants_D14, td15=tempdb..tablets_D15} 0 175
 PRED_QUERY_COLLECTION 2 {l=master..sysloginroles, s=master..syssrvroles, u=sybsystemprocs..sysusers} 0 259
 PRED_QUERY_COLLECTION 2 {l=master..sysloginroles, s=master..syssrvroles, u=sybsystemprocs..sysusers} 0 259
 PRED_QUERY_COLLECTION 2 {l=master..sysloginroles, s=master..syssrvroles, u=sybsystemprocs..sysusers} 0 259
 PRED_QUERY_COLLECTION 2 {l=master..sysloginroles, s=master..syssrvroles, u=sybsystemprocs..sysusers} 0 259

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

CALLERS
called by proc sybsystemprocs..sp_odbc_gettableprivileges  
called by proc sybsystemprocs..sp_jdbc_gettableprivileges