DatabaseProcApplicationCreatedLinks
sybsystemprocssp_server_info  14 déc. 14Defects Propagation Dependencies

1     
2     /* Sccsid = "%Z% generic/sproc/%M% %I% %G%" */
3     
4     /*
5     ** Messages for "sp_server_info"
6     **
7     ** 18059, "Attribute id %1! is not supported."
8     */
9     
10    create or replace procedure sp_server_info
11        @attribute_id int = NULL /* optional attribute id */
12    as
13    
14    
15        set nocount on
16    
17        /* If an attribute id was specified then just return the info for that
18        ** attribute.
19        */
20        if @attribute_id is not null
21        begin
22            /* Verify that the attribute is valid. */
23            if not exists (select attribute_id
24                    from sybsystemprocs.dbo.spt_server_info
25                    where attribute_id = @attribute_id)
26            begin
27                /*
28                ** 18059, "Attribute id %1! is not supported."
29                */
30                raiserror 18059, @attribute_id
31                return (1)
32            end
33    
34            /* Adaptive Server has expanded all '*' elements in the following statement */ select sybsystemprocs.dbo.spt_server_info.attribute_id, sybsystemprocs.dbo.spt_server_info.attribute_name, sybsystemprocs.dbo.spt_server_info.attribute_value
35            from sybsystemprocs.dbo.spt_server_info
36            where attribute_id = @attribute_id
37        end
38    
39        /* If no attribute was specified then return info for all supported
40        ** attributes.
41        */
42        else
43        begin
44            /* Adaptive Server has expanded all '*' elements in the following statement */ select sybsystemprocs.dbo.spt_server_info.attribute_id, sybsystemprocs.dbo.spt_server_info.attribute_name, sybsystemprocs.dbo.spt_server_info.attribute_value
45            from sybsystemprocs.dbo.spt_server_info
46        end
47    
48        return (0)
49    


exec sp_procxmode 'sp_server_info', 'AnyMode'
go

Grant Execute on sp_server_info to public
go
RESULT SETS
sp_server_info_rset_002
sp_server_info_rset_001

DEFECTS
 TNOI 4 Table with no index sybsystemprocs..spt_server_info sybsystemprocs..spt_server_info
 MGTP 3 Grant to public sybsystemprocs..sp_server_info  
 MUCO 3 Useless Code Useless Brackets 31
 MUCO 3 Useless Code Useless Brackets 48
 QCRS 3 Conditional Result Set 34
 QCRS 3 Conditional Result Set 44
 MRST 2 Result Set Marker 34
 MRST 2 Result Set Marker 44
 MSUB 2 Subquery Marker 23
 MTR1 2 Metrics: Comments Ratio Comments: 37% 10
 MTR2 2 Metrics: Cyclomatic Complexity Cyclo: 3 = 3dec - 2exi + 2 10
 MTR3 2 Metrics: Query Complexity Complexity: 16 10

DEPENDENCIES
PROCS AND TABLES USED
reads table sybsystemprocs..spt_server_info  
writes table sybsystemprocs..sp_server_info_rset_002 
writes table sybsystemprocs..sp_server_info_rset_001