Database | Proc | Application | Created | Links |
sybsystemprocs | sp_monitor_getcfgval | 31 Aug 14 | Defects Dependencies |
1 2 /* 3 ** This stored procedure provides the ability to get the configuration parameter 4 ** value given the name of the configuration parameter. 5 ** 6 ** Parameters: 7 ** @cfgname - configuration parameter name. 8 ** @value - Output parameter 9 ** @type - type of config value ('static', 'dynamic') 10 ** 11 ** Returns: 12 ** config value for the configuration parameter. 13 ** If 'static' is requested, the value from sysconfigures i 14 ** returned. If 'dynamic' is requested, the value from 15 ** syscurconfigs is returned. The caller has to choose which 16 ** value it wants returned, for validation. 17 { 18 */ 19 20 create procedure sp_monitor_getcfgval( 21 @cfgname varchar(100) 22 , @value int output 23 , @type varchar(10) = 'dynamic' 24 ) as 25 begin 26 declare @run_value int 27 , @cfg_value int 28 29 select @cfg_value = co.value 30 , @run_value = cu.value 31 from master.dbo.sysconfigures co 32 , master.dbo.syscurconfigs cu 33 where co.name = @cfgname 34 and co.config = cu.config 35 36 -- By default, return static configured value, unless 37 -- user has asked for run-value. 38 -- 39 select @value = case @type 40 when 'dynamic' then @cfg_value 41 else @run_value 42 end 43 44 return (0) 45 end -- } 46
exec sp_procxmode 'sp_monitor_getcfgval', 'AnyMode' go Grant Execute on sp_monitor_getcfgval to public go
DEFECTS | |
MINU 4 Unique Index with nullable columns master..sysconfigures | master..sysconfigures |
TNOI 4 Table with no index master..syscurconfigs | master..syscurconfigs |
MGTP 3 Grant to public master..sysconfigures | |
MGTP 3 Grant to public master..syscurconfigs | |
MGTP 3 Grant to public sybsystemprocs..sp_monitor_getcfgval | |
MUCO 3 Useless Code Useless Brackets in create proc | 20 |
MUCO 3 Useless Code Useless Begin-End Pair | 25 |
MUCO 3 Useless Code Useless Brackets | 44 |
QAFM 3 Var Assignment from potentially many rows | 29 |
QNAJ 3 Not using ANSI Inner Join | 31 |
QPRI 3 Join or Sarg with Rooted Partial Index Use SARG Candidate index: sysconfigures.csysconfigures unique clustered (name, parent, config) Intersection: {name} | 33 |
MTR1 2 Metrics: Comments Ratio Comments: 52% | 20 |
MTR2 2 Metrics: Cyclomatic Complexity Cyclo: 2 = 1dec - 1exi + 2 | 20 |
MTR3 2 Metrics: Query Complexity Complexity: 9 | 20 |
PRED_QUERY_COLLECTION 2 {c=master..sysconfigures, c2=master..syscurconfigs} 0 | 29 |