DatabaseProcApplicationCreatedLinks
sybsystemprocssp_monitor_connection_usage  31 Aug 14Defects Dependencies

1     
2     /*
3     ** sp_monitor_connection_usage
4     **
5     **	Generate help/usage information in terse/verbose mode.
6     {
7     */
8     create procedure sp_monitor_connection_usage(
9         @output_type varchar(10)
10    ) as
11        begin
12            declare @sqlmsg varchar(256)
13    
14            print " "
15            -- First generate terse messages.
16            exec sp_getmessage 19264, @sqlmsg output
17            print @sqlmsg
18            exec sp_getmessage 19265, @sqlmsg output
19            print @sqlmsg
20    
21            if (@output_type = 'terse')
22            begin
23                return 0
24            end
25    
26            print " "
27            print "  -- Monitor all connections, by cpu usage:"
28            print "	sp_monitor connection, 'cpu'"
29    
30            print " "
31            print "  -- Monitor all connections, by disk I/O usage:"
32            print "	sp_monitor connection, 'diskio'"
33    
34            return 0
35        end
36    


exec sp_procxmode 'sp_monitor_connection_usage', 'AnyMode'
go

Grant Execute on sp_monitor_connection_usage to public
go
DEFECTS
 MGTP 3 Grant to public sybsystemprocs..sp_monitor_connection_usage  
 MNER 3 No Error Check should check return value of exec 16
 MNER 3 No Error Check should check return value of exec 18
 MUCO 3 Useless Code Useless Brackets in create proc 8
 MUCO 3 Useless Code Useless Begin-End Pair 11
 MUCO 3 Useless Code Useless Brackets 21
 MTR1 2 Metrics: Comments Ratio Comments: 16% 8
 MTR2 2 Metrics: Cyclomatic Complexity Cyclo: 1 = 1dec - 2exi + 2 8
 MTR3 2 Metrics: Query Complexity Complexity: 17 8

DEPENDENCIES
PROCS AND TABLES USED
calls proc sybsystemprocs..sp_getmessage  
   reads table sybsystemprocs..sysusermessages  
   reads table master..sysmessages (1)  
   reads table master..syslanguages (1)  
   calls proc sybsystemprocs..sp_validlang  
      reads table master..syslanguages (1)