DatabaseProcApplicationCreatedLinks
sybsystemprocssp_monitor_archive_usage  14 déc. 14Defects Propagation Dependencies

1     
2     /*
3     ** sp_monitor_archive_usage
4     **
5     **	Generate help/usage info, in terse/verbose mode.
6     **
7     ** Parameters:
8     **	@output_type	- 'terse' or 'verbose'
9     {
10    */
11    create or replace procedure sp_monitor_archive_usage(
12        @output_type varchar(8)
13    ) as
14        begin
15            declare @usage varchar(10)
16                , @msg varchar(256)
17                , @prefix varchar(6)
18                , @mondeadlock varchar(11)
19                , @supported varchar(30)
20    
21            select @mondeadlock = 'monDeadLock'
22                , @prefix = 'daily_'
23    
24            print " "
25            exec sp_getmessage 18954, @usage output
26    
27            select @msg = @usage
28                + " sp_monitor 'archive [using prefix=<string>]' "
29                + "{, '<monitoring_type>' }"
30            print @msg
31    
32            select @supported = "'deadlock'"
33            exec sp_getmessage 19486, @msg output
34            print @msg, @supported
35    
36            if (@output_type = 'terse')
37                return 0
38    
39            print " "
40            exec sp_getmessage 19487, @msg output
41            print @msg, @mondeadlock
42            print "	sp_monitor archive, deadlock"
43    
44            print " "
45            select @supported = "tempdb" -- Reuse @variable for @dbname
46            exec sp_getmessage 19488, @msg output
47            print @msg, @prefix, @mondeadlock, @supported
48            print "	%1!..sp_monitor 'archive using prefix=%2!', deadlock"
49                , @supported, @prefix
50        end -- }
51    

DEFECTS
 MNER 3 No Error Check should check return value of exec 25
 MNER 3 No Error Check should check return value of exec 33
 MNER 3 No Error Check should check return value of exec 40
 MNER 3 No Error Check should check return value of exec 46
 MUCO 3 Useless Code Useless Brackets in create proc 11
 MUCO 3 Useless Code Useless Begin-End Pair 14
 MUCO 3 Useless Code Useless Brackets 36
 MTR1 2 Metrics: Comments Ratio Comments: 14% 11
 MTR2 2 Metrics: Cyclomatic Complexity Cyclo: 3 = 2dec - 1exi + 2 11
 MTR3 2 Metrics: Query Complexity Complexity: 22 11

DEPENDENCIES
PROCS AND TABLES USED
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)