DatabaseProcApplicationCreatedLinks
sybsystemprocssp_inst15015msg_us_mesg  14 déc. 14Defects Propagation Dependencies

1     
2     /*
3     ** SP_INST15015MSG_US_MESG
4     **
5     ** Description:
6     **	sproc to install English msgs.
7     **
8     ** Parameter:
9     **      @error_number
10    **	@severity_number
11    **	@message_text
12    **
13    */
14    create or replace procedure sp_inst15015msg_us_mesg
15        @error_number int,
16        @severity_number int,
17        @message_text varchar(255)
18    as
19        declare @retval int
20        declare @fmtbuf varchar(255)
21        set nocount on
22        select @retval = 0
23        select @retval = (select 1
24                from master.dbo.sysmessages
25                where error = @error_number and langid is NULL
26                )
27        /* message is not available so insert it. */
28        if (@message_text IS NOT NULL)
29        begin
30            if (@retval = 1)
31            begin
32                select @fmtbuf = (select "Modifying Message: "
33                        + convert(varchar(8), @error_number) + " Severity: "
34                        + convert(varchar(8), @severity_number))
35                print @fmtbuf
36                begin tran
37                update master.dbo.sysmessages
38                set error = @error_number,
39                    severity = @severity_number,
40                    dlevel = 2, /* dlevel is always 2 */
41                    description = @message_text,
42                    langid = NULL /* messages are shipped in English. */
43                where langid is NULL and error = @error_number
44                commit tran
45            end
46            else
47            begin
48                select @fmtbuf = "Adding Message: "
49                    + convert(varchar(8), @error_number) + " Severity: "
50                    + convert(varchar(8), @severity_number)
51                print @fmtbuf
52                begin tran
53                insert master.dbo.sysmessages values (
54                    @error_number,
55                    @severity_number,
56                    2, /* dlevel is always 2 */
57                    @message_text,
58                    NULL,
59                    NULL) /* messages are shipped in English. */
60                commit tran
61            end
62        end
63    

DEFECTS
 MCTR 4 Conditional Begin Tran or Commit Tran 36
 MCTR 4 Conditional Begin Tran or Commit Tran 44
 MCTR 4 Conditional Begin Tran or Commit Tran 52
 MCTR 4 Conditional Begin Tran or Commit Tran 60
 MINU 4 Unique Index with nullable columns master..sysmessages master..sysmessages
 MTYP 4 Assignment type mismatch severity: smallint = int 39
 MTYP 4 Assignment type mismatch severity: smallint = int 55
 MGTP 3 Grant to public master..sysmessages  
 MNER 3 No Error Check should check @@error after update 37
 MNER 3 No Error Check should check @@error after insert 53
 MUCO 3 Useless Code Useless Brackets 28
 MUCO 3 Useless Code Useless Brackets 30
 MUPK 3 Update column which is part of a PK or unique index error 38
 QPRI 3 Join or Sarg with Rooted Partial Index Use SARG Candidate index: sysmessages.ncsysmessages unique
(error, dlevel, langid)
Intersection: {error, langid}
25
 QPRI 3 Join or Sarg with Rooted Partial Index Use SARG Candidate index: sysmessages.ncsysmessages unique
(error, dlevel, langid)
Intersection: {error, langid}
43
 MSUB 2 Subquery Marker 23
 MTR1 2 Metrics: Comments Ratio Comments: 20% 14
 MTR2 2 Metrics: Cyclomatic Complexity Cyclo: 5 = 4dec - 1exi + 2 14
 MTR3 2 Metrics: Query Complexity Complexity: 27 14

DEPENDENCIES
PROCS AND TABLES USED
read_writes table master..sysmessages (1)  

CALLERS
called by proc sybsystemprocs..sp_inst15015msg_all_us_mesgs  
   called by proc sybsystemprocs..sp_inst15015msg  
      called by proc sybsystemprocs..sp_downgrade