DatabaseProcApplicationCreatedLinks
sybsystemprocssp_dropglockpromote  31 Aug 14Defects 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.  this sproc is just a wrapper around droplockpromote.
8     */
9     
10    /*
11    ** Messages for "sp_dropglockpromote"
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    ** 18168, "Invalid value '%1', specified for 'scope' parameter. Valid values are 'DATABASE' or 'TABLE'."
23    ** 18169, "Server-wide lock promotion values cannot be dropped. Use 'sp_configure' to restore server-wide defaults.
24    ** 18338, "Invalid obj_type parameter: '%1!'. Please specify 'PAGE' or 'ROW'."
25    */
26    
27    create procedure sp_dropglockpromote
28        @scope varchar(10), /* table, database or server */
29        @objname varchar(767) = NULL /* table or database name */
30    as
31    
32        declare @status int
33    
34        exec @status = sp_droplockpromote "PAGE", @scope, @objname
35        return (@status)
36    


exec sp_procxmode 'sp_dropglockpromote', 'AnyMode'
go

Grant Execute on sp_dropglockpromote to public
go
DEFECTS
 MGTP 3 Grant to public sybsystemprocs..sp_dropglockpromote  
 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: 74% 27
 MTR2 2 Metrics: Cyclomatic Complexity Cyclo: 1 = 0dec - 1exi + 2 27
 MTR3 2 Metrics: Query Complexity Complexity: 4 27

DEPENDENCIES
PROCS AND TABLES USED
calls proc sybsystemprocs..sp_droplockpromote  
   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)  
   reads table sybsystemprocs..sysobjects  
   reads table master..sysdatabases (1)  
   read_writes table sybsystemprocs..sysattributes