Database | Proc | Application | Created | Links |
sybsystemprocs | sp_compatmode | 31 Aug 14 | Defects Dependencies |
1 2 /* Sccsid = "%Z% generic/sproc/%M% %I% %G%" */ 3 /* 4.8 1.1 06/14/90 sproc/src/compatmode */ 4 5 /* 6 ** Messages for "sp_compatmode" 7 ** 8 ** 19963, "Compatibility mode is not enabled." 9 ** 19964, "Compatibility mode is enabled." 10 ** 19965, "WARNING: The configuration option 'histogram tuning factor' is configured with value '%1!', which is not the default value in ASE 12.5. This may lead to different accuracy of statistics and different query plans." 11 */ 12 13 create procedure sp_compatmode as 14 begin 15 16 declare @config_value_to_check int /* value of config option to be 17 ** checked. 18 */ 19 declare @msg varchar(1024) /* temp buffer for messages */ 20 21 select @config_value_to_check = NULL 22 23 if @@trancount = 0 24 begin 25 set chained off 26 end 27 28 set transaction isolation level 1 29 30 /* Get value of 'enable compatibility mode' option. */ 31 select @config_value_to_check = value 32 from master.dbo.sysconfigures 33 where config = 502 34 35 /* Nothing to check if compatibility mode is disabled.*/ 36 if (@config_value_to_check is not NULL 37 and @config_value_to_check = 0) 38 begin 39 exec sp_getmessage 19963, @msg output 40 print @msg 41 42 return (0) 43 end 44 else if (@config_value_to_check = 1) 45 begin 46 exec sp_getmessage 19964, @msg output 47 print @msg 48 end 49 50 /* 51 ** Raise warning message if abstract plan 52 ** dump/load/replace is also on. 53 */ 54 if exists (select * 55 from master.dbo.sysconfigures 56 where config in (383, 384, 385) 57 and value = 1) 58 begin 59 exec sp_getmessage 19961, @msg output 60 print @msg 61 end 62 63 /* 64 ** Raise warning message 19962 if literal 65 ** autoparam is on, but we need to check 66 ** if statment cache is on also. 67 */ 68 if exists (select * 69 from master.dbo.sysconfigures 70 where config = 414 and value != 0) 71 begin 72 if exists (select * 73 from master.dbo.sysconfigures 74 where config = 462 and value = 1) 75 begin 76 exec sp_getmessage 19962, @msg output 77 print @msg 78 end 79 end 80 81 /* 82 ** Raise warning message if the value of histogram 83 ** tuning factor is not 1, the default value in 84 ** ASE 12.5. 85 */ 86 select @config_value_to_check = value 87 from master.dbo.sysconfigures 88 where config = 433 89 90 if (@config_value_to_check is not NULL 91 and @config_value_to_check != 1) 92 begin 93 exec sp_getmessage 19965, @msg output 94 print @msg, @config_value_to_check 95 end 96 97 return (0) 98 99 end 100 101
exec sp_procxmode 'sp_compatmode', 'AnyMode' go Grant Execute on sp_compatmode to public go
DEPENDENCIES |
PROCS AND TABLES USED 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 master..sysconfigures (1) |