DatabaseProcApplicationCreatedLinks
sybsystemprocssp_oledb_getcolumnprivileges  14 déc. 14Defects Propagation Dependencies

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


exec sp_procxmode 'sp_oledb_getcolumnprivileges', 'AnyMode'
go

Grant Execute on sp_oledb_getcolumnprivileges to public
go
RESULT SETS
sp_oledb_getcolumnprivileges_rset_001

DEFECTS
 QCAR 6 Cartesian product between tables tempdb..actions_D1 actions and [tempdb..userrecord_D2 userrecord] 97
 QCAR 6 Cartesian product between tables tempdb..actions_D14 actions and [tempdb..userrecord_D15 userrecord] 231
 QJWI 5 Join or Sarg Without Index 174
 QJWI 5 Join or Sarg Without Index 176
 QJWI 5 Join or Sarg Without Index 178
 QJWI 5 Join or Sarg Without Index 183
 QJWI 5 Join or Sarg Without Index 186
 QJWI 5 Join or Sarg Without Index 188
 QJWI 5 Join or Sarg Without Index 190
 QJWI 5 Join or Sarg Without Index 274
 QJWI 5 Join or Sarg Without Index 278
 QJWI 5 Join or Sarg Without Index 280
 QJWI 5 Join or Sarg Without Index 282
 MEST 4 Empty String will be replaced by Single Space 25
 MEST 4 Empty String will be replaced by Single Space 28
 MEST 4 Empty String will be replaced by Single Space 31
 MEST 4 Empty String will be replaced by Single Space 34
 MEST 4 Empty String will be replaced by Single Space 37
 MEST 4 Empty String will be replaced by Single Space 40
 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}
147
 QTYP 4 Comparison type mismatch Comparison type mismatch: tinyint vs int 85
 QTYP 4 Comparison type mismatch Comparison type mismatch: tinyint vs int 147
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 276
 TNOI 4 Table with no index tempdb..COLUMNPRIVILEGES_D25 tempdb..COLUMNPRIVILEGES_D25
 TNOI 4 Table with no index tempdb..EXPLICITGRANTS_D13 tempdb..EXPLICITGRANTS_D13
 TNOI 4 Table with no index tempdb..IMPLICITGRANTS_D24 tempdb..IMPLICITGRANTS_D24
 TNOI 4 Table with no index tempdb..actions_D1 tempdb..actions_D1
 TNOI 4 Table with no index tempdb..actions_D14 tempdb..actions_D14
 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_D16 tempdb..posiblegrants_D16
 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_D21 tempdb..rolelist_D21
 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_D19 tempdb..syscolumns_D19
 TNOI 4 Table with no index tempdb..syscolumns_D23 tempdb..syscolumns_D23
 TNOI 4 Table with no index tempdb..sysprotects_D18 tempdb..sysprotects_D18
 TNOI 4 Table with no index tempdb..sysprotects_D22 tempdb..sysprotects_D22
 TNOI 4 Table with no index tempdb..sysprotects_D9 tempdb..sysprotects_D9
 TNOI 4 Table with no index tempdb..tabletcolumns_D17 tempdb..tabletcolumns_D17
 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_D20 tempdb..usedlist_D20
 TNOI 4 Table with no index tempdb..userrecord_D15 tempdb..userrecord_D15
 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 137
 MAW1 3 Warning message on %name% tempdb..objects_D5.id: Warning message on objects_D5 150
 MAW1 3 Warning message on %name% sybsystemprocs..sysobjects.id: Warning message on sysobjects 159
 MAW1 3 Warning message on %name% sybsystemprocs..syscolumns.id: Warning message on syscolumns 170
 MAW1 3 Warning message on %name% tempdb..columns_D6.id: Warning message on columns_D6 176
 MAW1 3 Warning message on %name% tempdb..objects_D5.id: Warning message on objects_D5 176
 MAW1 3 Warning message on %name% sybsystemprocs..syscolumns.id: Warning message on syscolumns 186
 MAW1 3 Warning message on %name% sybsystemprocs..sysprotects.id: Warning message on sysprotects 186
 MAW1 3 Warning message on %name% tempdb..syscolumns_D10.id: Warning message on syscolumns_D10 186
 MAW1 3 Warning message on %name% tempdb..sysprotects_D9.id: Warning message on sysprotects_D9 186
 MAW1 3 Warning message on %name% sybsystemprocs..syscolumns.id: Warning message on syscolumns 190
 MAW1 3 Warning message on %name% sybsystemprocs..sysprotects.id: Warning message on sysprotects 190
 MAW1 3 Warning message on %name% tempdb..usedlist_D11.id: Warning message on usedlist_D11 190
 MAW1 3 Warning message on %name% sybsystemprocs..sysobjects.id: Warning message on sysobjects 256
 MAW1 3 Warning message on %name% sybsystemprocs..syscolumns.id: Warning message on syscolumns 267
 MAW1 3 Warning message on %name% sybsystemprocs..sysobjects.id: Warning message on sysobjects 267
 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_D19.id: Warning message on syscolumns_D19 278
 MAW1 3 Warning message on %name% tempdb..sysprotects_D18.id: Warning message on sysprotects_D18 278
 MAW1 3 Warning message on %name% sybsystemprocs..syscolumns.id: Warning message on syscolumns 280
 MAW1 3 Warning message on %name% sybsystemprocs..sysprotects.id: Warning message on sysprotects 280
 MAW1 3 Warning message on %name% tempdb..usedlist_D20.id: Warning message on usedlist_D20 280
 MAW1 3 Warning message on %name% sybsystemprocs..syscolumns.id: Warning message on syscolumns 282
 MAW1 3 Warning message on %name% sybsystemprocs..sysprotects.id: Warning message on sysprotects 282
 MAW1 3 Warning message on %name% tempdb..syscolumns_D23.id: Warning message on syscolumns_D23 282
 MAW1 3 Warning message on %name% tempdb..sysprotects_D22.id: Warning message on sysprotects_D22 282
 MBLI 3 Integer Value of Binary Literal is Platform Dependant 179
 MBLI 3 Integer Value of Binary Literal is Platform Dependant 186
 MBLI 3 Integer Value of Binary Literal is Platform Dependant 190
 MBLI 3 Integer Value of Binary Literal is Platform Dependant 278
 MBLI 3 Integer Value of Binary Literal is Platform Dependant 280
 MBLI 3 Integer Value of Binary Literal is Platform Dependant 282
 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_oledb_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 8
 MUCO 3 Useless Code Useless Brackets 17
 MUCO 3 Useless Code Useless Brackets 21
 MUCO 3 Useless Code Useless Brackets 155
 MUCO 3 Useless Code Useless Brackets 186
 MUCO 3 Useless Code Useless Brackets 190
 MUCO 3 Useless Code Useless Brackets 278
 MUCO 3 Useless Code Useless Brackets 280
 MUCO 3 Useless Code Useless Brackets 282
 MUCO 3 Useless Code Useless Brackets 296
 QGWO 3 Group by/Distinct/Union without order by 57
 QGWO 3 Group by/Distinct/Union without order by 102
 QGWO 3 Group by/Distinct/Union without order by 111
 QGWO 3 Group by/Distinct/Union without order by 236
 QNUA 3 Should use Alias: Table sybsystemprocs..sysusers 188
 QNUA 3 Should use Alias: Table sybsystemprocs..syscolumns 190
 QNUA 3 Should use Alias: Table sybsystemprocs..sysprotects 190
 QNUA 3 Should use Alias: Table sybsystemprocs..sysusers 190
 QNUA 3 Should use Alias: Table master..sysconfigures 276
 QNUA 3 Should use Alias: Table sybsystemprocs..syscolumns 280
 QNUA 3 Should use Alias: Table sybsystemprocs..sysprotects 280
 QNUA 3 Should use Alias: Table sybsystemprocs..sysusers 280
 QPNC 3 No column in condition 276
 QPNC 3 No column in condition 286
 QUNI 3 Check Use of 'union' vs 'union all' 57
 QUNI 3 Check Use of 'union' vs 'union all' 102
 QUNI 3 Check Use of 'union' vs 'union all' 111
 QUNI 3 Check Use of 'union' vs 'union all' 236
 MDRV 2 Derived Table Marker 57
 MDRV 2 Derived Table Marker 60
 MDRV 2 Derived Table Marker 90
 MDRV 2 Derived Table Marker 102
 MDRV 2 Derived Table Marker 111
 MDRV 2 Derived Table Marker 123
 MDRV 2 Derived Table Marker 136
 MDRV 2 Derived Table Marker 149
 MDRV 2 Derived Table Marker 158
 MDRV 2 Derived Table Marker 169
 MDRV 2 Derived Table Marker 186
 MDRV 2 Derived Table Marker 190
 MDRV 2 Derived Table Marker 198
 MDRV 2 Derived Table Marker 224
 MDRV 2 Derived Table Marker 236
 MDRV 2 Derived Table Marker 245
 MDRV 2 Derived Table Marker 255
 MDRV 2 Derived Table Marker 278
 MDRV 2 Derived Table Marker 280
 MDRV 2 Derived Table Marker 282
 MRST 2 Result Set Marker 43
 MSUB 2 Subquery Marker 276
 MSUC 2 Correlated Subquery Marker 186
 MSUC 2 Correlated Subquery Marker 188
 MSUC 2 Correlated Subquery Marker 190
 MSUC 2 Correlated Subquery Marker 278
 MSUC 2 Correlated Subquery Marker 280
 MSUC 2 Correlated Subquery Marker 282
 MTR1 2 Metrics: Comments Ratio Comments: 8% 8
 MTR2 2 Metrics: Cyclomatic Complexity Cyclo: 15 = 15dec - 2exi + 2 8
 MTR3 2 Metrics: Query Complexity Complexity: 197 8
 PRED_QUERY_COLLECTION 2 {cd6=tempdb..columns_D6, od5=tempdb..objects_D5} 0 149
 PRED_QUERY_COLLECTION 2 {cd6=tempdb..columns_D6, od5=tempdb..objects_D5} 0 149
 PRED_QUERY_COLLECTION 2 {cd6=tempdb..columns_D6, od5=tempdb..objects_D5} 0 149
 PRED_QUERY_COLLECTION 2 {cd6=tempdb..columns_D6, od5=tempdb..objects_D5} 0 149
 PRED_QUERY_COLLECTION 2 {cd6=tempdb..columns_D6, od5=tempdb..objects_D5} 0 149
 PRED_QUERY_COLLECTION 2 {l=master..sysloginroles, pd3=tempdb..posiblegrants_D3, s=master..syssrvroles, u=sybsystemprocs..sysusers} 0 188
 PRED_QUERY_COLLECTION 2 {l=master..sysloginroles, pd3=tempdb..posiblegrants_D3, s=master..syssrvroles, u=sybsystemprocs..sysusers} 0 188
 PRED_QUERY_COLLECTION 2 {l=master..sysloginroles, pd3=tempdb..posiblegrants_D3, s=master..syssrvroles, u=sybsystemprocs..sysusers} 0 188
 PRED_QUERY_COLLECTION 2 {l=master..sysloginroles, s=master..syssrvroles, u=sybsystemprocs..sysusers} 0 190
 PRED_QUERY_COLLECTION 2 {l=master..sysloginroles, s=master..syssrvroles, u=sybsystemprocs..sysusers} 0 190
 PRED_QUERY_COLLECTION 2 {l=master..sysloginroles, s=master..syssrvroles, u=sybsystemprocs..sysusers} 0 190
 PRED_QUERY_COLLECTION 2 {l=master..sysloginroles, s=master..syssrvroles, u=sybsystemprocs..sysusers} 0 190
 PRED_QUERY_COLLECTION 2 {pd16=tempdb..posiblegrants_D16, td17=tempdb..tabletcolumns_D17} 0 198
 PRED_QUERY_COLLECTION 2 {pd16=tempdb..posiblegrants_D16, td17=tempdb..tabletcolumns_D17} 0 198
 PRED_QUERY_COLLECTION 2 {pd16=tempdb..posiblegrants_D16, td17=tempdb..tabletcolumns_D17} 0 198
 PRED_QUERY_COLLECTION 2 {c=sybsystemprocs..syscolumns, o=sybsystemprocs..sysobjects} 0 255
 PRED_QUERY_COLLECTION 2 {c=sybsystemprocs..syscolumns, o=sybsystemprocs..sysobjects} 0 255
 PRED_QUERY_COLLECTION 2 {c=sybsystemprocs..syscolumns, o=sybsystemprocs..sysobjects} 0 255
 PRED_QUERY_COLLECTION 2 {c=sybsystemprocs..syscolumns, o=sybsystemprocs..sysobjects} 0 255
 PRED_QUERY_COLLECTION 2 {l=master..sysloginroles, s=master..syssrvroles, u=sybsystemprocs..sysusers} 0 280
 PRED_QUERY_COLLECTION 2 {l=master..sysloginroles, s=master..syssrvroles, u=sybsystemprocs..sysusers} 0 280
 PRED_QUERY_COLLECTION 2 {l=master..sysloginroles, s=master..syssrvroles, u=sybsystemprocs..sysusers} 0 280
 PRED_QUERY_COLLECTION 2 {l=master..sysloginroles, s=master..syssrvroles, u=sybsystemprocs..sysusers} 0 280

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