DatabaseProcApplicationCreatedLinks
sybsystemprocssp_helpindex  14 déc. 14Defects Propagation Dependencies

1     
2     /* Sccsid = "%Z% generic/sproc/%M% %I% %G%" */
3     /*	4.8	1.1	06/14/90	sproc/src/help */
4     /*
5     ** Messages for "sp_helpindex"          17640
6     **
7     ** 17460, "Object must be in the current database."
8     ** 17461, "Object does not exist in this database."
9     ** 17640, "Object does not have any indexes."
10    ** 17641, "Object has the following indexes"
11    */
12    
13    /*
14    ** IMPORTANT NOTE:
15    ** This stored procedure uses the built-in function object_id() in the
16    ** where clause of a select query. If you intend to change this query
17    ** or use the object_id() or db_id() builtin in this procedure, please read the
18    ** READ.ME file in the $DBMS/generic/sproc directory to ensure that the rules
19    ** pertaining to object-id's and db-id's outlined there, are followed.
20    */
21    
22    create or replace procedure sp_helpindex
23        @objname varchar(767) /* the table to check for indexes */
24    as
25    
26        declare @indid int /* the index id of an index */
27        declare @keys varchar(1024) /* string to build up index key in */
28        declare @inddesc varchar(110) /* string to build up index desc in */
29        declare @msg varchar(1024)
30        declare @ptnstat int
31    
32        if @@trancount = 0
33        begin
34            set chained off
35        end
36    
37        set transaction isolation level 1
38    
39        /*
40        **  Check to see that the object names are local to the current database.
41        */
42        if @objname like "%.%.%" and
43            substring(@objname, 1, charindex(".", @objname) - 1) != db_name()
44        begin
45            /* 17460, "Object must be in the current database." */
46            raiserror 17460
47            return (1)
48        end
49    
50        /*
51        **  Check to see the the table exists 
52        */
53        if not exists (select id
54                from sysobjects
55                where id = object_id(@objname))
56        /*
57        **  Table doesn't exist so return.
58        */
59        begin
60            /* 17461, "Object does not exist in this database." */
61            raiserror 17461
62            return (1)
63        end
64    
65        /*
66        **  See if the object has any indexes.
67        **  Since there may be more than one entry in sysindexes for the object,
68        **  this select will set @indid to the index id of the first index.
69        */
70        select @indid = min(indid)
71        from sysindexes
72        where id = object_id(@objname)
73            and indid > 0
74            and indid < 255
75    
76        /*
77        **  If no indexes, return.
78        */
79        if @indid is NULL
80        begin
81            /* 17640, "Object does not have any indexes." */
82            exec sp_getmessage 17640, @msg output
83            print @msg
84            return (1)
85        end
86    
87        /*
88        **  Now check out each index, figure out it's type and keys and
89        **  save the info in a temporary table that we'll print out at the end.
90        */
91        create table #spindtab
92        (
93            index_name varchar(255),
94            index_keys varchar(1024),
95            index_description varchar(68),
96            index_max_rows_per_page smallint,
97            index_fillfactor smallint,
98            index_reservepagegap smallint,
99            index_created datetime NULL,
100           index_local varchar(255)
101       )
102   
103       /*  Create temporary table for sysattributes data */
104       create table #spindattr
105       (
106           name varchar(255),
107           class smallint,
108           attribute smallint,
109           int_value int NULL,
110           char_value varchar(255) NULL,
111           comments varchar(255) NULL
112       )
113   
114       /* This is for the index partition information. */
115       create table #spindptn
116       (
117           index_ptn_name varchar(255),
118           index_ptn_seg varchar(255),
119           index_ptn_comp varchar(255)
120       )
121   
122       while @indid is not NULL
123       begin
124   
125           /*
126           **  First we'll figure out what the keys are.
127           */
128           declare @i int
129           declare @thiskey varchar(255)
130           declare @sorder char(4)
131           declare @lastindid int
132   
133           select @keys = "", @i = 1
134   
135           set nocount on
136   
137           while @i <= 31
138           begin
139               select @thiskey = index_col(@objname, @indid, @i)
140   
141               if (@thiskey is NULL)
142               begin
143                   goto keysdone
144               end
145   
146               if @i > 1
147               begin
148                   select @keys = @keys + ", "
149               end
150   
151               /*select @keys = @keys + index_col(@objname, @indid, @i)*/
152               select @keys = @keys + @thiskey
153   
154               /*
155               ** Get the sort order of the column using index_colorder()
156               ** This support is added for handling descending keys.
157               */
158               select @sorder = index_colorder(@objname, @indid, @i)
159               if (@sorder = "DESC")
160                   select @keys = @keys + " " + @sorder
161   
162               /*
163               **  Increment @i so it will check for the next key.
164               */
165               select @i = @i + 1
166   
167           end
168   
169   
170           /*
171           **  When we get here we now have all the keys.
172           */
173   keysdone:
174           set nocount off
175   
176   
177           /*
178           **  Initialize the index description by figuring out if it's a
179           **  clustered or nonclustered index.
180           */
181           if @indid = 1
182           begin
183               select @inddesc = "clustered"
184           end
185           if @indid > 1
186           begin
187               if exists (select * from sysindexes i
188                       where status2 & 512 = 512
189                           and i.indid = @indid
190                           and i.id = object_id(@objname))
191               begin
192                   select @inddesc = "clustered"
193               end
194               else
195               begin
196                   select @inddesc = "nonclustered"
197               end
198           end
199   
200           /*
201           **  Now we'll check out the status bits for this index and
202           **  build an english description from them.
203           */
204   
205           /*
206           **  See if the index is unique (0x02).
207           */
208           if exists (select *
209                   from master.dbo.spt_values v, sysindexes i
210                   where i.status & v.number = v.number
211                       and v.type = "I"
212                       and v.number = 2
213                       and i.id = object_id(@objname)
214                       and i.indid = @indid)
215           begin
216               select @inddesc = @inddesc + ", " + v.name
217               from master.dbo.spt_values v, sysindexes i
218               where i.status & v.number = v.number
219                   and v.type = "I"
220                   and v.number = 2
221                   and i.id = object_id(@objname)
222                   and i.indid = @indid
223           end
224           else
225           /* 
226           ** if this is a nonunique clustered index on dol tables, dup rows
227           ** are allowed
228           */
229           if exists (select * from sysindexes i
230                   where status2 & 512 = 512
231                       and i.indid = @indid
232                       and i.id = object_id(@objname))
233           begin
234               select @inddesc = @inddesc + ", " + v.name
235               from master.dbo.spt_values v, sysindexes i
236               where v.type = "I"
237                   and v.number = 64
238                   and i.id = object_id(@objname)
239                   and i.indid = @indid
240           end
241   
242           /*
243           **  See if the index is ignore_dupkey (0x01).
244           */
245           if exists (select *
246                   from master.dbo.spt_values v, sysindexes i
247                   where i.status & v.number = v.number
248                       and v.type = "I"
249                       and v.number = 1
250                       and i.id = object_id(@objname)
251                       and i.indid = @indid)
252           begin
253               select @inddesc = @inddesc + ", " + v.name
254               from master.dbo.spt_values v, sysindexes i
255               where i.status & v.number = v.number
256                   and v.type = "I"
257                   and v.number = 1
258                   and i.id = object_id(@objname)
259                   and i.indid = @indid
260           end
261   
262           /*
263           **  See if the index is ignore_dup_row (0x04).
264           */
265           if exists (select *
266                   from master.dbo.spt_values v, sysindexes i
267                   where i.status & v.number = v.number
268                       and v.type = "I"
269                       and v.number = 4
270                       and i.id = object_id(@objname)
271                       and i.indid = @indid)
272           begin
273               select @inddesc = @inddesc + ", " + v.name
274               from master.dbo.spt_values v, sysindexes i
275               where i.status & v.number = v.number
276                   and v.type = "I"
277                   and v.number = 4
278                   and i.id = object_id(@objname)
279                   and i.indid = @indid
280           end
281   
282           /*
283           **  See if the index is allow_dup_row (0x40).
284           */
285           if exists (select *
286                   from master.dbo.spt_values v, sysindexes i
287                   where i.status & v.number = v.number
288                       and v.type = "I"
289                       and v.number = 64
290                       and i.id = object_id(@objname)
291                       and i.indid = @indid)
292           begin
293               select @inddesc = @inddesc + ", " + v.name
294               from master.dbo.spt_values v, sysindexes i
295               where i.status & v.number = v.number
296                   and v.type = "I"
297                   and v.number = 64
298                   and i.id = object_id(@objname)
299                   and i.indid = @indid
300           end
301   
302           /*
303           **  See if the index is compressed (0x200).
304           */
305           if exists (select *
306                   from master.dbo.spt_values v, sysindexes i
307                   where i.status3 & v.number = v.number
308                       and v.type = "I3"
309                       and v.number = 512
310                       and i.id = object_id(@objname)
311                       and i.indid = @indid)
312           begin
313               select @inddesc = @inddesc + ", " + v.name
314               from master.dbo.spt_values v, sysindexes i
315               where i.status3 & v.number = v.number
316                   and v.type = "I3"
317                   and v.number = 512
318                   and i.id = object_id(@objname)
319                   and i.indid = @indid
320           end
321   
322           /*
323           **  See if the index is compressed (0x400).
324           */
325           if exists (select *
326                   from master.dbo.spt_values v, sysindexes i
327                   where i.status3 & v.number = v.number
328                       and v.type = "I3"
329                       and v.number = 1024
330                       and i.id = object_id(@objname)
331                       and i.indid = @indid)
332           begin
333               select @inddesc = @inddesc + ", " + v.name
334               from master.dbo.spt_values v, sysindexes i
335               where i.status3 & v.number = v.number
336                   and v.type = "I3"
337                   and v.number = 1024
338                   and i.id = object_id(@objname)
339                   and i.indid = @indid
340           end
341   
342           /*
343           **  Now we have the whole description for the index so we'll add
344           **  the goods to the temporary table.
345           */
346           insert into #spindtab
347           select name, @keys, @inddesc, maxrowsperpage, fill_factor,
348               isnull(res_page_gap, 0), crdate,
349               case when (status3 & 8 = 8) then "Local Index"
350                   else "Global Index"
351               end
352           from sysindexes
353           where id = object_id(@objname)
354               and indid = @indid
355           /* 
356           **  Get sysattributes data if there is any
357           */
358           insert #spindattr(name, class, attribute, int_value, char_value,
359               comments)
360           select i.name, a.class, a.attribute, a.int_value, a.char_value,
361               a.comments
362           from sysindexes i, sysattributes a
363           where a.object_type = "I"
364               and a.object = object_id(@objname)
365               and a.object_info1 = @indid
366               and i.id = object_id(@objname)
367               and i.indid = @indid
368   
369   
370           /*
371           ** We are printing out index information. Because we will never
372           ** index compress APL clustered index, the output for APL clustered
373           ** index would be always "inherit from index"
374           */
375           insert #spindptn(index_ptn_name, index_ptn_seg, index_ptn_comp)
376           select idxptn_nam = p.name, segment = s.name,
377               case when (p.indid = 1) then "inherit from index"
378                   when (p.status & 512 = 512) then "index compressed"
379                   when (p.status & 128 = 128) then "none"
380                   else "inherit from index"
381               end
382           from syssegments s, syspartitions p
383           where s.segment = p.segment and p.id = object_id(@objname)
384               and p.indid = @indid
385   
386           /*
387           ** It's possible a cache is deleted without doing an unbind first. After
388           ** a server reboot the binding is marked 'invalid' (int_value = 0).
389           ** If we have such an invalid binding, don't show it in the output.
390           */
391           delete from #spindattr
392           where class = 3
393               and attribute = 0
394               and int_value = 0
395   
396           /*
397           **  Now move @indid to the next index.
398           */
399           select @lastindid = @indid
400           select @indid = NULL
401           select @indid = min(indid)
402           from sysindexes
403           where id = object_id(@objname)
404               and indid > @lastindid
405               and indid < 255
406       end
407   
408       /*
409       **  Now print out the contents of the temporary index table.
410       */
411       exec sp_getmessage 17641, @msg output
412       print @msg
413       print ""
414   
415       exec sp_autoformat #spindtab
416   
417       drop table #spindtab
418   
419       exec sp_autoformat #spindptn
420   
421       drop table #spindptn
422   
423   
424       /*
425       ** If the table has functional indexes, display all the functional index 
426       ** keys.
427       */
428       if exists (select 1 from sysindexes i where i.id = object_id(@objname) and
429                   (status2 & 32768) = 32768)
430       begin
431           print ""
432           execute dbo.sp_helpcomputedcolumn @objname, 1
433       end
434   
435       /*  
436       ** Print sysattributes data if there is any.  The join with
437       ** master..sysattributes is to get the string descriptions for the
438       ** class (master.dbo.sysattributes cn) and attribute
439       ** (master.dbo.sysattributes an). These should never be more than
440       ** 30 characters, so it's okay to truncate them to 30.
441       */
442   
443       if exists (select * from #spindattr)
444       begin
445           select name = a.name, attribute_class =
446               convert(varchar(448), cn.char_value),
447               attribute = convert(varchar(448), an.char_value),
448               a.int_value,
449               char_value = convert(varchar(448), a.char_value), a.comments
450           into #sphelpindex1rs
451           from #spindattr a, master.dbo.sysattributes cn,
452               master.dbo.sysattributes an
453           where a.class = cn.object
454               and a.attribute = an.object_info1
455               and a.class = an.object
456               and cn.class = 0
457               and cn.attribute = 0
458               and an.class = 0
459               and an.attribute = 1
460           exec sp_autoformat @fulltabname = #sphelpindex1rs
461           drop table #sphelpindex1rs
462       end
463       drop table #spindattr
464       return (0)
465   


exec sp_procxmode 'sp_helpindex', 'AnyMode'
go

Grant Execute on sp_helpindex to public
go
DEFECTS
 QJWI 5 Join or Sarg Without Index 210
 QJWI 5 Join or Sarg Without Index 218
 QJWI 5 Join or Sarg Without Index 247
 QJWI 5 Join or Sarg Without Index 255
 QJWI 5 Join or Sarg Without Index 267
 QJWI 5 Join or Sarg Without Index 275
 QJWI 5 Join or Sarg Without Index 287
 QJWI 5 Join or Sarg Without Index 295
 QJWI 5 Join or Sarg Without Index 307
 QJWI 5 Join or Sarg Without Index 315
 QJWI 5 Join or Sarg Without Index 327
 QJWI 5 Join or Sarg Without Index 335
 QJWI 5 Join or Sarg Without Index 383
 MEST 4 Empty String will be replaced by Single Space 133
 MEST 4 Empty String will be replaced by Single Space 413
 MEST 4 Empty String will be replaced by Single Space 431
 MINU 4 Unique Index with nullable columns master..sysattributes master..sysattributes
 MINU 4 Unique Index with nullable columns sybsystemprocs..sysattributes sybsystemprocs..sysattributes
 MMCN 4 Potentially Misleading Column Naming 376
 MTYP 4 Assignment type mismatch index_description: varchar(68) = varchar(110) 347
 MTYP 4 Assignment type mismatch char_value: varchar(255) = varchar(768) 360
 MUSP 4 Unquoted String Parameter sybsystemprocs..sp_autoformat: parameter # 1 415
 MUSP 4 Unquoted String Parameter sybsystemprocs..sp_autoformat: parameter # 1 419
 MUSP 4 Unquoted String Parameter sybsystemprocs..sp_autoformat: @fulltabname 460
 QCAS 4 Cartesian product with single row between tables master..spt_values v and [sybsystemprocs..sysindexes i], 2 tables with rc=1 234
 QCAS 4 Cartesian product with single row between tables sybsystemprocs..sysindexes i and [sybsystemprocs..sysattributes a], 2 tables with rc=... 360
 QPUI 4 Join or Sarg with Un-Rooted Partial Index Use SARG Candidate index: sysattributes.csysattributes unique clustered
(class, attribute, object_type, object, object_info1, object_info2, object_info3, object_cinfo)
Intersection: {object, object_info1, object_type}
363
 QPUI 4 Join or Sarg with Un-Rooted Partial Index Use JOIN Candidate index: sysattributes.csysattributes unique clustered
(class, attribute, object_type, object, object_info1, object_info2, object_info3, object_cinfo)
Intersection: {object}
Uncovered: [object_type, object_info1, object_info2, object_info3, object_cinfo]
453
 QPUI 4 Join or Sarg with Un-Rooted Partial Index Use JOIN Candidate index: sysattributes.csysattributes unique clustered
(class, attribute, object_type, object, object_info1, object_info2, object_info3, object_cinfo)
Intersection: {object, object_info1}
Uncovered: [object_type, object_info2, object_info3, object_cinfo]
454
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 73
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 74
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 189
 QTYP 4 Comparison type mismatch smallint = int 189
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 214
 QTYP 4 Comparison type mismatch smallint = int 214
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 222
 QTYP 4 Comparison type mismatch smallint = int 222
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 231
 QTYP 4 Comparison type mismatch smallint = int 231
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 239
 QTYP 4 Comparison type mismatch smallint = int 239
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 251
 QTYP 4 Comparison type mismatch smallint = int 251
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 259
 QTYP 4 Comparison type mismatch smallint = int 259
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 271
 QTYP 4 Comparison type mismatch smallint = int 271
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 279
 QTYP 4 Comparison type mismatch smallint = int 279
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 291
 QTYP 4 Comparison type mismatch smallint = int 291
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 299
 QTYP 4 Comparison type mismatch smallint = int 299
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 311
 QTYP 4 Comparison type mismatch smallint = int 311
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 319
 QTYP 4 Comparison type mismatch smallint = int 319
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 331
 QTYP 4 Comparison type mismatch smallint = int 331
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 339
 QTYP 4 Comparison type mismatch smallint = int 339
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 354
 QTYP 4 Comparison type mismatch smallint = int 354
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 367
 QTYP 4 Comparison type mismatch smallint = int 367
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 377
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 384
 QTYP 4 Comparison type mismatch smallint = int 384
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 392
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 393
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 404
 QTYP 4 Comparison type mismatch smallint = int 404
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 405
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 453
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 454
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 455
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 456
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 457
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 458
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 459
 TNOI 4 Table with no index sybsystemprocs..syssegments sybsystemprocs..syssegments
 TNOU 4 Table with no unique index master..spt_values master..spt_values
 MAW1 3 Warning message on %name% sybsystemprocs..sysobjects.id: Warning message on sysobjects 53
 MAW1 3 Warning message on %name% sybsystemprocs..sysobjects.id: Warning message on sysobjects 55
 MAW1 3 Warning message on %name% sybsystemprocs..sysindexes.id: Warning message on sysindexes 72
 MAW1 3 Warning message on %name% sybsystemprocs..sysindexes.id: Warning message on sysindexes 190
 MAW1 3 Warning message on %name% sybsystemprocs..sysindexes.id: Warning message on sysindexes 213
 MAW1 3 Warning message on %name% sybsystemprocs..sysindexes.id: Warning message on sysindexes 221
 MAW1 3 Warning message on %name% sybsystemprocs..sysindexes.id: Warning message on sysindexes 232
 MAW1 3 Warning message on %name% sybsystemprocs..sysindexes.id: Warning message on sysindexes 238
 MAW1 3 Warning message on %name% sybsystemprocs..sysindexes.id: Warning message on sysindexes 250
 MAW1 3 Warning message on %name% sybsystemprocs..sysindexes.id: Warning message on sysindexes 258
 MAW1 3 Warning message on %name% sybsystemprocs..sysindexes.id: Warning message on sysindexes 270
 MAW1 3 Warning message on %name% sybsystemprocs..sysindexes.id: Warning message on sysindexes 278
 MAW1 3 Warning message on %name% sybsystemprocs..sysindexes.id: Warning message on sysindexes 290
 MAW1 3 Warning message on %name% sybsystemprocs..sysindexes.id: Warning message on sysindexes 298
 MAW1 3 Warning message on %name% sybsystemprocs..sysindexes.id: Warning message on sysindexes 310
 MAW1 3 Warning message on %name% sybsystemprocs..sysindexes.id: Warning message on sysindexes 318
 MAW1 3 Warning message on %name% sybsystemprocs..sysindexes.id: Warning message on sysindexes 330
 MAW1 3 Warning message on %name% sybsystemprocs..sysindexes.id: Warning message on sysindexes 338
 MAW1 3 Warning message on %name% sybsystemprocs..sysindexes.id: Warning message on sysindexes 353
 MAW1 3 Warning message on %name% sybsystemprocs..sysindexes.id: Warning message on sysindexes 366
 MAW1 3 Warning message on %name% sybsystemprocs..syspartitions.id: Warning message on syspartitions 383
 MAW1 3 Warning message on %name% sybsystemprocs..sysindexes.id: Warning message on sysindexes 403
 MAW1 3 Warning message on %name% sybsystemprocs..sysindexes.id: Warning message on sysindexes 428
 MGTP 3 Grant to public master..spt_values  
 MGTP 3 Grant to public master..sysattributes  
 MGTP 3 Grant to public sybsystemprocs..sp_helpindex  
 MGTP 3 Grant to public sybsystemprocs..sysattributes  
 MGTP 3 Grant to public sybsystemprocs..sysindexes  
 MGTP 3 Grant to public sybsystemprocs..sysobjects  
 MGTP 3 Grant to public sybsystemprocs..syspartitions  
 MGTP 3 Grant to public sybsystemprocs..syssegments  
 MNER 3 No Error Check should check return value of exec 82
 MNER 3 No Error Check should check @@error after insert 346
 MNER 3 No Error Check should check @@error after insert 358
 MNER 3 No Error Check should check @@error after insert 375
 MNER 3 No Error Check should check @@error after delete 391
 MNER 3 No Error Check should check return value of exec 411
 MNER 3 No Error Check should check return value of exec 415
 MNER 3 No Error Check should check return value of exec 419
 MNER 3 No Error Check should check return value of exec 432
 MNER 3 No Error Check should check @@error after select into 445
 MNER 3 No Error Check should check return value of exec 460
 MUCO 3 Useless Code Useless Brackets 47
 MUCO 3 Useless Code Useless Brackets 62
 MUCO 3 Useless Code Useless Brackets 84
 MUCO 3 Useless Code Useless Brackets 141
 MUCO 3 Useless Code Useless Brackets 159
 MUCO 3 Useless Code Useless Brackets 349
 MUCO 3 Useless Code Useless Brackets 377
 MUCO 3 Useless Code Useless Brackets 378
 MUCO 3 Useless Code Useless Brackets 379
 MUCO 3 Useless Code Useless Brackets 464
 MUIN 3 Column created using implicit nullability 91
 MUIN 3 Column created using implicit nullability 104
 MUIN 3 Column created using implicit nullability 115
 QCTC 3 Conditional Table Creation 445
 QISO 3 Set isolation level 37
 QNAJ 3 Not using ANSI Inner Join 209
 QNAJ 3 Not using ANSI Inner Join 217
 QNAJ 3 Not using ANSI Inner Join 235
 QNAJ 3 Not using ANSI Inner Join 246
 QNAJ 3 Not using ANSI Inner Join 254
 QNAJ 3 Not using ANSI Inner Join 266
 QNAJ 3 Not using ANSI Inner Join 274
 QNAJ 3 Not using ANSI Inner Join 286
 QNAJ 3 Not using ANSI Inner Join 294
 QNAJ 3 Not using ANSI Inner Join 306
 QNAJ 3 Not using ANSI Inner Join 314
 QNAJ 3 Not using ANSI Inner Join 326
 QNAJ 3 Not using ANSI Inner Join 334
 QNAJ 3 Not using ANSI Inner Join 362
 QNAJ 3 Not using ANSI Inner Join 382
 QNAJ 3 Not using ANSI Inner Join 451
 QPRI 3 Join or Sarg with Rooted Partial Index Use SARG Candidate index: syspartitions.csyspartitions unique clustered
(id, indid, partitionid)
Intersection: {indid, id}
383
 QPRI 3 Join or Sarg with Rooted Partial Index Use SARG Candidate index: sysindexes.csysindexes unique clustered
(id, indid)
Intersection: {id}
428
 VUNU 3 Variable is not used @ptnstat 30
 MSUB 2 Subquery Marker 53
 MSUB 2 Subquery Marker 187
 MSUB 2 Subquery Marker 208
 MSUB 2 Subquery Marker 229
 MSUB 2 Subquery Marker 245
 MSUB 2 Subquery Marker 265
 MSUB 2 Subquery Marker 285
 MSUB 2 Subquery Marker 305
 MSUB 2 Subquery Marker 325
 MSUB 2 Subquery Marker 428
 MTR1 2 Metrics: Comments Ratio Comments: 31% 22
 MTR2 2 Metrics: Cyclomatic Complexity Cyclo: 87 = 89dec - 4exi + 2 22
 MTR3 2 Metrics: Query Complexity Complexity: 260 22
 PRED_QUERY_COLLECTION 2 {p=sybsystemprocs..syspartitions, s=sybsystemprocs..syssegments} 0 376

DEPENDENCIES
PROCS AND TABLES USED
reads table sybsystemprocs..sysattributes  
reads table master..sysattributes (1)  
reads table sybsystemprocs..syssegments  
reads table sybsystemprocs..sysindexes  
calls proc sybsystemprocs..sp_autoformat  
   reads table tempdb..systypes (1)  
   writes table sybsystemprocs..sp_autoformat_rset_001 
   read_writes table tempdb..#colinfo_af (1) 
   writes table sybsystemprocs..sp_autoformat_rset_005 
   writes table sybsystemprocs..sp_autoformat_rset_003 
   reads table master..systypes (1)  
   writes table sybsystemprocs..sp_autoformat_rset_004 
   calls proc sybsystemprocs..sp_autoformat  
   calls proc sybsystemprocs..sp_namecrack  
   writes table sybsystemprocs..sp_autoformat_rset_002 
   reads table master..syscolumns (1)  
   reads table tempdb..syscolumns (1)  
reads table master..spt_values (1)  
writes table tempdb..#spindtab (1) 
reads table sybsystemprocs..sysobjects  
reads table sybsystemprocs..syspartitions  
writes table tempdb..#spindptn (1) 
writes table tempdb..#sphelpindex1rs (1) 
calls proc sybsystemprocs..sp_helpcomputedcolumn  
   reads table master..syscurconfigs (1)  
   reads table sybsystemprocs..syscolumns  
   reads table sybsystemprocs..syscomments  
   read_writes table tempdb..#helptxt (1) 
   calls proc sybsystemprocs..sp_autoformat  
   reads table sybsystemprocs..sysobjects  
   writes table tempdb..#helpname (1) 
   calls proc sybsystemprocs..sp_getmessage  
      reads table master..syslanguages (1)  
      reads table sybsystemprocs..sysusermessages  
      calls proc sybsystemprocs..sp_validlang  
         reads table master..syslanguages (1)  
      reads table master..sysmessages (1)  
   read_writes table tempdb..#helpcpc (1) 
calls proc sybsystemprocs..sp_getmessage  
read_writes table tempdb..#spindattr (1) 

CALLERS
called by proc sybsystemprocs..sp_help