DatabaseProcApplicationCreatedLinks
sybsystemprocssp_dropglockpromote_ptn  14 déc. 14Defects Propagation Dependencies

1     
2     /* Stored procedure for dropping lock promotion attributes. 
3     ** Database attributes can only be modified when using Master.
4     */
5     
6     /* NOTE: Any changes to this sproc in /main should actually be made in
7     ** droplockpromote_ptn.  this sproc is just a wrapper around droplockpromote_ptn.
8     */
9     
10    /*
11    ** Messages for "sp_dropglockpromote_ptn"
12    **
13    ** 17260, "Can't run %1! from within a transaction."
14    ** 17421, "No such database -- run sp_helpdb to list databases."
15    ** 17460, "Object must be in the current database."
16    ** 18076, "Could not set curwrite to object level. Set your maxwrite label correctly."
17    ** 18090, "The target object does not exist."
18    ** 18159, "You must be in the 'master' database to add, change or drop lock promotion attribute for a user database."
19    ** 18162, "'%1!' is a not a user table. '%2' can be used only on user tables."
20    ** 18166, "Lock promotion attribute does not exist for %1, '%2'. Cannot delete it."
21    ** 18167, "Lock promotion attribute of object '%1!' has been dropped!."
22    ** RESOLVE: Add new msg in msgdb which includes PARTITION and SERVER
23    ** 18168, "Invalid value '%1', specified for 'scope' parameter. Valid values are 'DATABASE' or 'TABLE'."
24    ** 18338, "Invalid obj_type parameter: '%1!'. Please specify 'PAGE' or 'ROW'."
25    */
26    
27    create or replace procedure sp_dropglockpromote_ptn
28        @scope varchar(10), /* partition, table, database or server */
29        @objname varchar(767) = NULL /* "table.partition", table or database name */
30    as
31    
32        declare @status int
33    
34        exec @status = sp_droplockpromote_ptn "PAGE", @scope, @objname
35        return (@status)
36    


exec sp_procxmode 'sp_dropglockpromote_ptn', 'AnyMode'
go

Grant Execute on sp_dropglockpromote_ptn to public
go
DEFECTS
 MGTP 3 Grant to public sybsystemprocs..sp_dropglockpromote_ptn  
 MNER 3 No Error Check should check return value of exec 34
 MUCO 3 Useless Code Useless Brackets 35
 MTR1 2 Metrics: Comments Ratio Comments: 73% 27
 MTR2 2 Metrics: Cyclomatic Complexity Cyclo: 2 = 1dec - 1exi + 2 27
 MTR3 2 Metrics: Query Complexity Complexity: 4 27

DEPENDENCIES
PROCS AND TABLES USED
calls proc sybsystemprocs..sp_droplockpromote_ptn  
   calls proc sybsystemprocs..sp_aux_checkroleperm  
      reads table master..sysconfigures (1)  
      reads table master..syscurconfigs (1)  
   read_writes table sybsystemprocs..sysattributes  
   calls proc sybsystemprocs..sp_getmessage  
      reads table master..syslanguages (1)  
      calls proc sybsystemprocs..sp_validlang  
         reads table master..syslanguages (1)  
      reads table master..sysmessages (1)  
      reads table sybsystemprocs..sysusermessages  
   reads table master..sysdatabases (1)  
   reads table sybsystemprocs..sysobjects