DatabaseProcApplicationCreatedLinks
sybsystemprocssp_downgrade_dump_config  14 déc. 14Defects Propagation Dependencies

1     
2     /*
3     ** SP_DOWNGRADE_DUMP_CONFIG
4     **
5     ** Description
6     **	Removes all DUMP CONFIG options
7     {
8     */
9     create or replace procedure sp_downgrade_dump_config @show_cmd int = 0
10    as
11        begin
12            declare @cfg varchar(255)
13    
14            set proc_return_status off
15            set nocount on
16    
17            declare c cursor for
18            select object_cinfo from master.dbo.sysattributes
19            where class = 40 and object_type = "DC"
20    
21            open c
22            fetch c into @cfg
23            while (@@sqlstatus = 0)
24            begin
25                if (@show_cmd = 1)
26                    print "exec sp_config_dump %1!, 'delete'", @cfg
27    
28                exec sp_config_dump @cfg, 'delete'
29                fetch c into @cfg
30            end
31    
32            close c
33            deallocate cursor c
34        end
35    


exec sp_procxmode 'sp_downgrade_dump_config', 'AnyMode'
go

Grant Execute on sp_downgrade_dump_config to public
go
DEFECTS
 MINU 4 Unique Index with nullable columns master..sysattributes master..sysattributes
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 19
 CUNU 3 Cursor not updated: cursor should contain 'for read only' clause c 18
 MGTP 3 Grant to public master..sysattributes  
 MGTP 3 Grant to public sybsystemprocs..sp_downgrade_dump_config  
 MNER 3 No Error Check should check return value of exec 28
 MUCO 3 Useless Code Useless Begin-End Pair 11
 MUCO 3 Useless Code Useless Brackets 23
 MUCO 3 Useless Code Useless Brackets 25
 QPRI 3 Join or Sarg with 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: {class, object_type}
19
 CUPD 2 Updatable Cursor Marker (updatable by default) 18
 MTR1 2 Metrics: Comments Ratio Comments: 11% 9
 MTR2 2 Metrics: Cyclomatic Complexity Cyclo: 5 = 4dec - 1exi + 2 9
 MTR3 2 Metrics: Query Complexity Complexity: 19 9

DEPENDENCIES
PROCS AND TABLES USED
calls proc sybsystemprocs..sp_config_dump  
   read_writes table master..sysattributes (1)  
   read_writes table tempdb..#dump_config_table (1) 
   read_writes table tempdb..#optioncfg (1) 
   writes table tempdb..#dumpcfgname (1) 
   calls proc sybsystemprocs..sp_autoformat  
      reads table master..systypes (1)  
      reads table tempdb..syscolumns (1)  
      writes table sybsystemprocs..sp_autoformat_rset_003 
      writes table sybsystemprocs..sp_autoformat_rset_005 
      calls proc sybsystemprocs..sp_autoformat  
      writes table sybsystemprocs..sp_autoformat_rset_002 
      calls proc sybsystemprocs..sp_namecrack  
      reads table tempdb..systypes (1)  
      reads table master..syscolumns (1)  
      read_writes table tempdb..#colinfo_af (1) 
      writes table sybsystemprocs..sp_autoformat_rset_001 
      writes table sybsystemprocs..sp_autoformat_rset_004 
   calls proc sybsystemprocs..sp_aux_checkroleperm  
      reads table master..syscurconfigs (1)  
      reads table master..sysconfigures (1)  
reads table master..sysattributes (1)