DatabaseProcApplicationCreatedLinks
sybsystemprocssp_addtabledef  14 déc. 14Defects Propagation Dependencies

1     
2     /* Sccsid = "%Z% generic/sproc/src/%M% %I% %G%" */
3     
4     /*
5     ** Omni only
6     **
7     ** Messages for "sp_addtabledef".  Additional messages are issued from
8     ** sp_addobjectdef, which this procedure invokes.
9     **
10    ** 18312, "Object type is '%1!'."
11    ** 18313, "Unrecognized storage_location type '%1!'."
12    */
13    
14    create or replace procedure sp_addtabledef
15        @tablename varchar(1023), /* local table name */
16        @objectdef varchar(255), /* path to remote/external object */
17        @objecttype varchar(10) = "table" /* object type  */
18    as
19        begin
20    
21            declare @msg varchar(1024),
22                @status int
23    
24            /*
25            ** See if the objectdef actually represents a remote server
26            ** object.
27            */
28            if exists (select * from master.dbo.spt_values where type = 'E' and name = 'vms')
29            begin
30                if charindex(":", @objectdef) > 0
31                begin
32                    /*
33                    ** 18312, "Object type is '%1!'."
34                    */
35                    select @objecttype = "file"
36                    exec sp_getmessage 18312, @msg output
37                    print @msg, @objecttype
38                end
39            end
40            else if @objectdef like "%.%.%.%"
41            begin
42                /*
43                ** 18312, "Object type is '%1!'."
44                */
45                select @objecttype = "table"
46                exec sp_getmessage 18312, @msg output
47                print @msg, @objecttype
48            end
49            else
50            begin
51                /*
52                ** 18313, Unable to determine storage_location type for '%1!'
53                */
54                raiserror 18313, @objectdef
55                return (1)
56            end
57    
58            exec @status = sp_addobjectdef @tablename, @objectdef, @objecttype
59    
60            return (@status)
61        end
62    


exec sp_procxmode 'sp_addtabledef', 'AnyMode'
go

Grant Execute on sp_addtabledef to public
go
DEFECTS
 QPUI 4 Join or Sarg with Un-Rooted Partial Index Use SARG Candidate index: spt_values.spt_valuesclust clustered
(number, type)
Intersection: {type}
28
 TNOU 4 Table with no unique index master..spt_values master..spt_values
 MGTP 3 Grant to public master..spt_values  
 MGTP 3 Grant to public sybsystemprocs..sp_addtabledef  
 MNER 3 No Error Check should check return value of exec 36
 MNER 3 No Error Check should check return value of exec 46
 MNER 3 No Error Check should check return value of exec 58
 MUCO 3 Useless Code Useless Begin-End Pair 19
 MUCO 3 Useless Code Useless Brackets 55
 MUCO 3 Useless Code Useless Brackets 60
 MSUB 2 Subquery Marker 28
 MTR1 2 Metrics: Comments Ratio Comments: 37% 14
 MTR2 2 Metrics: Cyclomatic Complexity Cyclo: 5 = 5dec - 2exi + 2 14
 MTR3 2 Metrics: Query Complexity Complexity: 21 14

DATA PROPAGATION detailed
ColumnWritten To
@objectdefsysattributes.int_value   °.char_value   sp_passwordpolicy_rset_002.value sp_passwordpolicy_rset_003.value sp_passwordpolicy_rset_004.Policy_option sp_ssladmin_rset_001.certificate_path sp_ssladmin_rset_002.Cipher Suite Name °.Preference
@tablenamesysattributes.object_info1   °.char_value   sysattributes.object_cinfo   °.object_info1   °.int_value   °.char_value   sp_dropdevice_rset_001.device sp_displayroles_rset_001.Role Name sp_displayroles_rset_002.Role Name sp_displayroles_rset_003.Role Name
sp_displayroles_rset_004.Role Name sp_dropdevice_rset_001.device sp_forceonline_object_rset_001.Object °.status sp_forceonline_object_rset_002.Object °.status sp_forceonline_page_rset_001.status sp_forceonline_page_rset_002.status sp_listsuspect_object_rset_001.Object °.Access
sp_listsuspect_page_rset_001.Object °.Access sp_makesuspect_obj_rset_001.Obj °.Indid °.LogType °.PageType °.ErrType °.Delay °.TotalNum sp_makesuspect_obj_rset_002.Obj
°.Indid °.LogType °.PageType °.ErrType °.Delay °.TotalNum sp_makesuspect_obj_rset_003.Obj °.Indid °.LogType °.PageType
°.ErrType °.Delay °.TotalNum sp_memlog_rset_001.dumps_per_file sp_passwordpolicy_rset_001.message sp_passwordpolicy_rset_002.value sp_passwordpolicy_rset_003.value sp_passwordpolicy_rset_004.Policy_option sp_rjs_retrieve_rset_001.host_name sp_setsuspect_granularity_rset_001.Online mode
sp_ssladmin_rset_001.certificate_path sp_ssladmin_rset_002.Cipher Suite Name °.Preference

DEPENDENCIES
PROCS AND TABLES USED
reads table master..spt_values (1)  
calls proc sybsystemprocs..sp_getmessage  
   reads table master..sysmessages (1)  
   reads table sybsystemprocs..sysusermessages  
   calls proc sybsystemprocs..sp_validlang  
      reads table master..syslanguages (1)  
   reads table master..syslanguages (1)  
calls proc sybsystemprocs..sp_addobjectdef  
   reads table master..sysservers (1)  
   reads table sybsystemprocs..sysobjects  
   calls proc sybsystemprocs..sp_namecrack  
   calls proc sybsystemprocs..sp_aux_checkroleperm  
      reads table master..syscurconfigs (1)  
      reads table master..sysconfigures (1)  
   read_writes table sybsystemprocs..sysattributes  
   calls proc sybsystemprocs..sp_iqdbcheck  
   reads table master..spt_values (1)  
   reads table sybsystemprocs..syscolumns