DatabaseProcApplicationCreatedLinks
sybsystemprocssp_configure  14 déc. 14Defects Propagation Dependencies

1     
2     /* Sccsid = "%Z% generic/sproc/%M% %I% %G%" */
3     /*	4.8	1.1	06/14/90	sproc/src/configure */
4     
5     /*
6     ** Messages for "sp_configure"          17410
7     **      Must use "langid" when referencing spt_values
8     **
9     ** 17260, "Can't run %1! from within a transaction." 
10    ** 17410, "Configuration option doesn't exist."
11    ** 17411, "Configuration option is not unique."
12    ** 17413, "The value of the 'number of devices' must not be less than the number of active devices '%1!'
13    ** 17414, "You can't set the default language to a language ID that is not defined in Syslanguages."
14    ** 17415, "Configuration option value is not legal."
15    ** 17418, "'%1!' is an invalid file command. The valid commands are 'verify', 'read', 'write', and 'restore'."
16    ** 17419, "Configuration option changed. The SQL Server need not be rebooted since the option is dynamic.
17    ** 18123, "Configuration option changed. The SQL Server must be rebooted before the change in effect since the option is static."
18    ** 18124, "No matching configuration options.  Here is a listing of groups:"
19    ** 18125, "Must provide the parameter 'filename'."
20    ** 18133, "The character set, '%1!', is invalid since it is not defined in Syscharsets."
21    ** 18134, "The sortorder, '%1!', is invalid since it is not defined in Syscharsets."
22    ** 18397, "Changing the value of '%1!' does not increase the amount of 
23    **        memory Adaptive Server uses.
24    **
25    ** 18549, "Invalid third argument supplied: '%1!'. Valid choices are
26    **	   'with truncate' or 'default'."
27    **
28    ** 18915, "An additional %1! K bytes of memory is available for 
29    ** 	  reconfiguration. This is the difference between 'max memory' 
30    **	  and 'total logical memory'."
31    **
32    ** 18916, "Changing the value of '%1!' to '%2!' increases the amount of
33    ** 	  memory ASE uses by %3! K."
34    **
35    ** 18917, "Changing the value of '%1!' to '%2!' reduces the amount of
36    ** 	  memory ASE uses by %3! K. The reduced memory may be reused
37    **	  when this configure value changes, but will not be released
38    **	  until ASE restarts."
39    **
40    ** 18932, "Resulting configuration value and memory use have not changed 
41    **	  from previous values: new configuration value %1!, previous %2!."
42    **
43    ** 19106, "Cannot change the value of configuration parameter 'global cache 
44    **	  partition number' when the server is in recovery."
45    ** 
46    ** 19107, "Cannot change the value of configuration parameter 'max concurrently 
47    **	  recovered dbs' because the server is still in recovery setup."
48    **
49    ** 19108, "Cannot change the configuration parameter 'max concurrently
50    **	   recovered dbs' to %1 when the server is in recovery. The only value 
51    **	   allowed is 1.
52    **
53    ** 19109, "Cannot change the value of configuration parameter 'global async
54    **	  prefetch limit' when the server is in recovery."
55    **
56    ** 19416, "Provider class '%1!' is not a recognized messaging provider class."
57    **
58    ** 19519, "Cannot run sp_configure for server '%1!' since you are not
59    **	  connecting to it." 
60    **
61    ** 19520, "Cannot configure '%1!' for an instance, since it is a strictly 
62    **	  cluster-wide option." 
63    **
64    ** 19521, "Cannot configure '%1!' to cluster-wide since all active instances 
65    **	  have instance-specific setting on this option."
66    **
67    ** 19570, "Cannot drop the instance-specific configuration for configuration
68    **	  parameter '%1!' since the configuration setting does not exist."
69    **
70    ** 19574, "An instance name needs to be provided. "
71    **
72    ** 19654, "Warning: In Shared Disk Cluster, all instances share the same 
73    **	  configuration file. Please run sp_configure to read the configuration 
74    **        file for all other instances to keep the configuration consistent."
75    ** 19816, "You cannot set configuration values from inside a local temporary
76    **	  database."
77    ** 19874, "Cannot configure '%1!' to cluster-wide since it is an 
78    **	  instance-specific-only option."
79    ** 19953, "Cannot change the value of configuration parameter 'config file 
80    **	  version' because it is server generated."
81    **
82    ** 19961, "WARNING: Compatibility mode will not be used when 'abstract plan dump/load/replace' is on."
83    ** 19962, "WARNING: Compatibility mode may not be used when statement cache and literal autoparam are enabled."
84    ** 19966, "WARNING: Enabling compatibility mode will not affect the query plans already stored in the procedure cache."
85    ** 19967, "WARNING: The configuration option 'statement cache size' is configured with value '%1!'. Enabling compatibility mode will not affect the query plans already stored in the statement cache."
86    */
87    
88    create or replace procedure sp_configure
89        @configname varchar(255) = NULL, /* configure option name */
90        @configvalue int = NULL, /* configure value */
91        @configvalue2 varchar(255) = NULL, /* config file command/charset info */
92        @configvalue3 varchar(255) = NULL /* physical name of file */
93    as
94    
95        declare @confignum int /* number of option to be configured */
96        declare @configcount int /* number of options like @configname */
97        declare @whichone int /* using english or default lang ? */
98        declare @cmd smallint /* configuration file command */
99        declare @status int /* return status for misc calls */
100       declare @children int /* number of children in a group */
101       declare @parent int /* config number of parent group */
102       declare @msg varchar(1024) /* temp buffer for messages */
103       declare @sysconfig smallint /* contents of sysconfigures.config */
104       declare @sysname varchar(255) /* contents of sysconfigures.comment */
105       declare @sysparent smallint /* contents of sysconfigures.parent */
106       declare @sysstatus int /* contents of sysconfigures.status */
107       declare @value int /* default charset/sort order id */
108       declare @user_displaylevel int /* user display level */
109       declare @numdevices int /* number of active devices */
110       declare @sorder_chset_id int /* current sortorder or character set id */
111       declare @use_wildcard tinyint /* use wildcard to search option name or not */
112       declare @match_count int /* number of option found by name match */
113       declare @cmpstate int /* Local NODE state in companionship */
114       declare @additional_free_memory int /* Additional Free memory */
115       declare @logical_memory int /* total logical memory before 
116       change*/
117       declare @lmemconfignum int /* confignum for 'total logical memory' */
118       declare @additional_memory int /* increase in logical memory due 
119       to change*/
120       declare @oldcfgvalue int /* 
121       ** previous config value for parameter
122       ** with integer type.
123       */
124       declare @oldcfgvalue_char varchar(255)
125       /*
126       ** previous config value for parameter
127       ** with character type.
128       */
129       declare @defvalue varchar(255) /* default config value */
130       declare @fullconfigname varchar(255) /* configure option name */
131       declare @bvalue int /* base value after unit 
132       converting*/
133       declare @unit varchar(20)
134       declare @nocase tinyint /* case-sensitive sort order flag */
135       declare @rec_state varchar(30) /* the server recovery state */
136       declare @new_class smallint /* for valid messaging provider
137       ** class
138       */
139       declare @is_equal int /*
140       ** flag to check whether configuration
141       ** value and run value are same or not.
142       */
143       declare @configcount2 int /* number of options for an instance. */
144       declare @configcount3 int /* number of options for an instance. */
145       declare @match_count2 int /* number of option found by name and
146       ** instance match.
147       */
148       declare @instanceid tinyint /* instance id */
149       declare @use_cluster int /* if cluster-wide value is used. */
150       declare @remote_instance_name varchar(255)
151       /* remote instance name */
152       declare @remote_instance_id tinyint
153       /* remote instance id */
154       declare @retstat int
155       declare @sqlbuf varchar(255)
156   
157       declare @non_default_options int /* this option is set when nondefault
158       settings  are to be displayed*/
159       declare @tmp_rtms_value int /* to store the value of 'enable real time messaging'*/
160       declare @all_rtms_provider_set int /* to store bit map while all rtms provider enabled*/
161       declare @cfg_rtms_provider_mask int /* to check if the required rtms provider enabled */
162       declare @cfg_rtms_all_mask int /* to check if all options of rtms enabled */
163       declare @optlevel_def varchar(11) /* default value for optlevel */
164       declare @optlevel_run varchar(12) /* run value for optlevel */
165       declare @optlevel_curr varchar(12) /* current value for optlevel */
166   
167       declare @config_value_to_check int /* value of config option to be 
168       ** checked with compatibility mode.
169       */
170       declare @app_config int /* config number if application functionality */
171       declare @cha_area varchar(10) /* for configuration history auditing */
172       declare @cha_type varchar(30)
173       declare @cha_target varchar(30)
174       declare @cha_element varchar(255)
175       declare @cha_oldvalue varchar(255)
176       declare @cha_newvalue varchar(255)
177       declare @cha_mode varchar(10)
178       declare @cha_instanceid int
179       declare @cha_ret int
180   
181   
182       /*
183       ** Disallow running sp_configure within a transaction since it might make
184       ** recovery impossible.
185       ** Do the @@trancount check before initializing any local variables,
186       ** because "select" statement itself will start a transaction
187       ** if chained mode is on.
188       */
189       declare @nullarg char(1)
190       declare @dummy int
191       declare @status1 int
192       declare @gp_enabled int
193       declare @errnum int
194       declare @permerr16802 int
195       declare @permerr10331 int
196       declare @permerr10353 int
197   
198   
199       if @@trancount > 0
200       begin
201           /*
202           ** 17260, "Can't run %1! from within a transaction."
203           */
204           raiserror 17260, "sp_configure"
205           return (1)
206       end
207       else
208       begin
209           set chained off
210       end
211   
212       select @whichone = 0
213       select @status = 0
214       select @cmd = 1
215       select @value = NULL
216       select @user_displaylevel = NULL
217       select @sorder_chset_id = 0
218       select @is_equal = 0
219       select @use_wildcard = 1
220       select @config_value_to_check = NULL
221       select @use_cluster = 0
222       select @instanceid = NULL
223       select @permerr16802 = 16802
224       select @permerr10331 = 10331
225       select @permerr10353 = 10353
226       select @errnum = 0
227   
228       /*
229       ** Check if the default sort order is case-insensitive.
230       */
231       if ("A" = "a")
232           select @nocase = 1
233       else
234           select @nocase = 0
235   
236       /*
237       ** The word 'default' has a special interpretation in this procedure. We want
238       ** it to be case-insensitive so we will recognize it when we see it. Thus, if
239       ** @configvalue2 contains some flavor of 'default' and the sort order is not
240       ** case-insensitive, we will force 'default' to lower case.
241       */
242       if @nocase = 0
243           and @configvalue2 is not null
244           and lower(@configvalue2) = 'default'
245           select @configvalue2 = 'default'
246   
247       set transaction isolation level 1
248       set nocount on /* Adaptive Server has expanded all '*' elements in the following statement */
249   
250       /*
251       ** Prepare values for'optimizer level'.
252       */
253       select [master].dbo.spt_values.name, [master].dbo.spt_values.number, [master].dbo.spt_values.[type], [master].dbo.spt_values.ansi_w, [master].dbo.spt_values.low, [master].dbo.spt_values.high, [master].dbo.spt_values.msgnum into #optlevel
254       from master.dbo.spt_values where type = 'OL'
255           and name like 'ase%'
256   
257       select @optlevel_def = name
258       from master.dbo.syscurconfigs, #optlevel
259       where config = 507
260           and number = convert(int, defvalue)
261   
262       select @optlevel_run = name
263       from master.dbo.syscurconfigs, #optlevel
264       where config = 507
265           and number = convert(int, value2)
266   
267       select @optlevel_curr = name
268       from master.dbo.syscurconfigs, #optlevel
269       where config = 507
270           and number = convert(int, value)
271   
272       /*
273       **      If the "default sortorder" is case insensitive dictionary sort order,
274       ** the procedure will just print out all the options and their values
275       ** without grouping if no option name is given.
276       */
277       if (@nocase = 1 and @configname is NULL)
278       begin
279           /* Display all config parameters for specified instance. */
280   
281   
282           select "Parameter Name" = convert(char(30), name),
283               "Default" = CASE WHEN b.config = 507 THEN @optlevel_def
284                   ELSE convert(char(11),
285                       space(11 - char_length(
286                               convert(varchar(11), defvalue))) +
287                       convert(varchar(11), defvalue))
288               END,
289               "Memory Used" = convert(char(11),
290               space(11 - char_length(
291                       convert(varchar(11), c.comment))) +
292               convert(varchar(11), c.comment)),
293               "Config Value" = CASE WHEN b.config = 507 THEN @optlevel_curr
294                   ELSE convert(char(12),
295                       space(12 - char_length(
296                               isnull(b.value2,
297                                   convert(char(32), b.value)))) +
298                       isnull(b.value2, convert(char(32), b.value)))
299               END,
300               "Run Value" = CASE WHEN b.config = 507 THEN @optlevel_run
301                   ELSE convert(char(12),
302                       space(12 - char_length(isnull(c.value2,
303                                   convert(char(32), c.value)))) +
304                       isnull(c.value2, convert(char(32), c.value)))
305               END,
306               "Unit" = convert(char(20), c.unit),
307   
308               "Type" = convert(char(20), c.type)
309   
310           from master.dbo.sysconfigures b,
311               master.dbo.syscurconfigs c
312           where
313   
314               b.config *= c.config
315               and b.config != 19
316               and parent != 19
317   
318   
319           return (0)
320   
321   
322       end
323   
324   
325   
326   
327       /* check whether nondefault settings are to be displyed.*/
328       if (@configname is not NULL)
329       begin
330   
331           if "display nondefault settings" like "%" + @configname + "%"
332           begin
333               declare @countno int
334   
335               /*check if configuration option is unique*/
336   
337               select @countno = count(*)
338               from master.dbo.sysconfigures
339               where name like "%" + @configname + "%"
340                   and parent != 19
341   
342   
343               /*
344               ** if configuration option is not unique, display the duplicates
345               ** and return
346               */
347               if @countno > 0
348               begin
349   
350                   select name
351                   into #temptab
352                   from master.dbo.sysconfigures a
353                   where name like "%" + @configname + "%"
354                       and parent != 19
355   
356                   insert into #temptab values
357                   ("display nondefault settings")
358   
359                   raiserror 17411
360                   print ""
361                   print "Choose option from the following"
362                   print ""
363                   exec sp_autoformat #temptab
364                   return (1)
365               end
366               /*
367               ** if configuration option is unique set non_default_options=1, 
368               ** and make configname=NULL so that next block is bypassed
369               */
370               else
371               begin
372                   select @non_default_options = 1
373                   select @configname = NULL
374               end
375   
376           end
377       end
378   
379       /* Validate the configname if it not NULL */
380       if @configname is not NULL
381       begin
382           /* Check the duplicate rows for cluster-wide settings. */
383           select @configcount = count(*)
384           from master.dbo.sysconfigures
385           where name like "%" + @configname + "%"
386               and parent != 19
387   
388   
389           /*
390           **      If configure option is not unique and case-insensitive
391           ** dictionary sort order is used, check if unique option found
392           ** by exact name match, if so, then disable wildcard match
393           ** for searching option name.
394           */
395           if ((@configcount > 1
396   
397                   )
398                   and @nocase = 1)
399   
400   
401           begin
402               /* check if unique option found by exact name match */
403               select @match_count = count(*)
404               from master.dbo.sysconfigures
405               where name = @configname
406                   and parent != 19
407   
408   
409               if (@match_count = 1
410   
411                   )
412               begin
413                   select @use_wildcard = 0 /* don't use wildcard */
414   
415                   if @match_count = 1
416                   begin
417                       select @configcount = @match_count
418                   end
419   
420   
421               end
422           end
423   
424           /*
425           ** If more than one option like @configname,
426           ** show the duplicates and return.
427           */
428           if @configcount > 1
429   
430           begin
431               /*
432               ** 17411, "Configuration option is not unique."
433               */
434               raiserror 17411
435               print ""
436   
437               select "Parameter Name" = convert(char(30), name),
438                   "Default" = CASE WHEN a.config = 507 THEN @optlevel_def
439                       ELSE convert(char(11), space(11 - char_length(
440                                   convert(varchar(11), defvalue))) +
441                           convert(varchar(11), defvalue))
442                   END,
443                   "Memory Used" = convert(char(11), space(11 - char_length(
444                           convert(varchar(11), b.comment))) +
445                   convert(varchar(11), b.comment)),
446                   "Config Value" = CASE WHEN a.config = 507 THEN @optlevel_curr
447                       WHEN a.config = 565 THEN convert(char(255), +
448                       isnull(a.value2, convert(char(255), a.value)))
449                       ELSE convert(char(12), space(12 - char_length(
450                                   isnull(a.value2, convert(char(32), a.value)))) +
451                           isnull(a.value2, convert(char(32), a.value)))
452                   END,
453                   "Run Value" = CASE WHEN a.config = 507 THEN @optlevel_run
454                       WHEN a.config = 565 THEN convert(char(255), +
455                       isnull(b.value2, convert(char(255), b.value)))
456                       ELSE convert(char(12), space(12 - char_length(
457                                   isnull(b.value2, convert(char(32), b.value)))) +
458                           isnull(b.value2, convert(char(32), b.value)))
459                   END,
460                   "Unit" = convert(char(20), b.unit),
461   
462                   "Type" = convert(char(10), b.type)
463   
464   
465               from master.dbo.sysconfigures a,
466                   master.dbo.syscurconfigs b
467               where
468   
469                   a.config *= b.config
470                   and name like "%" + @configname + "%"
471                   and parent != 19
472                   and a.config != 19
473   
474               order by name
475   
476               /*
477               **  If @configname like '%memory%' print message. 
478               **  18915, "An additional %1! K bytes of memory is available 
479               **  for reconfiguration. This is the difference between 
480               **  'max memory' and 'total logical memory'."
481               **
482               */
483               if (lower(@configname) like '%memory%')
484               begin
485                   select @additional_free_memory =
486                       (max(b.value) - min(b.value)) * 2
487                   from master.dbo.sysconfigures a,
488                       master.dbo.syscurconfigs b
489                   where a.name in ('max memory',
490                           'total logical memory')
491   
492                       and a.config = b.config
493   
494   
495                   exec sp_getmessage 18915, @msg output
496                   print @msg, @additional_free_memory
497               end
498               return (1)
499           end
500   
501           /*
502           ** if it is a valid option and the @configvalue is not NULL,
503           ** set the option
504           */
505           if (@configcount != 0) and (@configvalue is not NULL)
506           begin
507               /* set @confignum */
508               select @confignum = config,
509                   @sysstatus = status,
510                   @fullconfigname = name
511               from master.dbo.sysconfigures
512               where name like "%" + @configname + "%"
513                   and parent != 19
514                   and config != 19
515   
516               /* Disallow running sp_configure on "config file version". */
517               if (@confignum = 504)
518               begin
519                   /* 
520                   ** 19953, "Cannot change the value of configuration 
521                   ** parameter 'config file version' because it 
522                   ** is server generated." 
523                   */
524                   raiserror 19953
525                   return (1)
526               end
527   
528   
529   
530               /*
531               ** Later, we will want to test whether the config value is
532               ** actually changing.  Obtain the current and default values
533               ** for this config so we can ignore requests that result in
534               ** no change.  Here, if the parameter datatype is (var)char,
535               ** @oldcfgvalue will be 0; if it's an int, @oldcfgvalue_char
536               ** will be NULL.
537               */
538               select @oldcfgvalue = b.value,
539                   @oldcfgvalue_char = b.value2,
540                   @defvalue = c.defvalue,
541                   @parent = b.parent
542               from master.dbo.sysconfigures b,
543                   master.dbo.syscurconfigs c
544               where b.config = @confignum
545   
546                   and b.config *= c.config
547   
548   
549               /* 
550               ** The @oldcfgvalue could be NULL if this is the 
551               ** first time configuration of an instance value.  
552               ** If this is the case, get the @oldcfgvalue from 
553               ** the cluster-wide settings.  
554               */
555               if @oldcfgvalue is NULL
556               begin
557                   select @oldcfgvalue = b.value,
558                       @oldcfgvalue_char = b.value2,
559                       @defvalue = c.defvalue
560                   from master.dbo.sysconfigures b,
561                       master.dbo.syscurconfigs c
562                   where b.config = @confignum
563   
564                       and b.config *= c.config
565   
566               end
567   
568   
569               if (@configvalue2 = "default")
570               begin
571                   select @value = 1
572                   if @oldcfgvalue_char is null
573                   begin
574                       /*
575                       ** For config options in group 'Application 
576                       ** Functionality', the "default" is the current
577                       ** value of option 'enable functionality group'. 
578                       ** That means if 'enable functionality group' is
579                       ** 1, the 'default' value for individual feature
580                       ** is 1.
581                       */
582                       if (@confignum != 543 and @parent = 49)
583                       begin
584                           select @configvalue = value
585                           from master.dbo.sysconfigures
586                           where config = 543
587                       end
588                       else
589                       begin
590                           select @configvalue = convert(int, @defvalue)
591                       end
592                   end
593               end
594               else
595                   select @value = 0
596   
597               /*
598               **  If the option name is "configuration file",
599               **  take action, then return.
600               */
601               if @confignum = 114
602               begin
603                   /*
604                   ** if the file command is not one of the valid
605                   ** commands, complain and then quit.
606                   */
607                   if @configvalue2 not in ("read", "write", "restore",
608                           "verify")
609                   begin
610                       /*
611                       ** print the message to show the valid
612                       ** file command
613                       */
614                       raiserror 17418, @configvalue2
615                       return (1)
616                   end
617   
618                   /*
619                   ** if filename is NULL
620                   */
621                   if (@configvalue3 is NULL)
622                   begin
623                       /* 18125, "Must provide the parameter 'filename'." */
624                       raiserror 18125
625                       return (1)
626                   end
627   
628                   /* 
629                   ** If granular permissions is not enabled then sa_role 
630                   ** is required.  If granular permissions is enabled 
631                   ** then the permission 'manage server configuration' is
632                   ** required.  proc_role and proc_auditperm will also do
633                   ** auditing if required. Both will also print error 
634                   ** message if required.
635                   */
636   
637                   select @nullarg = NULL
638                   execute @status1 = sp_aux_checkroleperm "sa_role",
639                       "manage server configuration", @nullarg,
640                       @gp_enabled output
641   
642                   /* For Auditing */
643                   if (@gp_enabled = 0)
644                   begin
645                       if (proc_role("sa_role") = 0)
646                       begin
647                           return (1)
648                       end
649                   end
650                   else
651                   begin
652                       select @dummy = proc_auditperm(
653                               "manage server configuration", @status1)
654                   end
655   
656                   if (@status1 != 0)
657                       return (1)
658   
659                   select @cmd = case
660                           when (@configvalue2 = "verify") then 2
661                           when (@configvalue2 = "read") then 3
662                           when (@configvalue2 = "write") then 4
663                           else 5 -- "restore"
664                       end
665   
666   
667                   select @status = config_admin(@cmd, 0, 0, 0, NULL,
668                           @configvalue3)
669   
670                   select @errnum = @@error
671                   if ((@errnum = @permerr10331)
672                           or (@errnum = @permerr10353)
673                           or (@errnum = @permerr16802))
674                   begin
675                       return 1
676                   end
677   
678                   /* 
679                   ** config_admin returns FALSE if error. 
680                   ** True otherwise. 
681                   */
682                   if (@status = 1)
683                   begin
684                       /*
685                       ** record the configuration file operation for
686                       ** configuration history auditing
687                       */
688                       select @cha_area = "SERVER"
689                       select @cha_type = "sp_configure"
690                       select @cha_target = @configvalue2 + " " + name
691                       from master.dbo.sysconfigures
692                       where config = @confignum
693                       select @cha_element = @configvalue3
694                       select @cha_oldvalue = NULL
695                       select @cha_newvalue = NULL
696                       select @cha_mode = type
697                       from master.dbo.syscurconfigs
698                       where config = @confignum
699                       select @cha_instanceid = NULL
700   
701                       select @cha_ret = audit_config_history(
702                               @cha_area,
703                               @cha_type,
704                               @cha_target,
705                               @cha_element,
706                               @cha_oldvalue,
707                               @cha_newvalue,
708                               @cha_mode,
709                               @cha_instanceid)
710                       return (0)
711                   end
712   
713                   return (1)
714               end
715   
716               if @confignum = 123
717               begin
718                   /* get current default charset id */
719                   select @value = value from
720                       master.dbo.sysconfigures
721                   where config = 131
722   
723                   select @sorder_chset_id = @value
724                   if @configvalue2 is not NULL
725                   begin
726                       /*
727                       ** Get default charset id from name and
728                       ** validate the charset id.
729                       */
730                       select @value = id
731                       from master..syscharsets
732                       where name = @configvalue2
733                           and type between 1000 and 1999
734   
735                       if @value is null
736                       begin
737                           /* 18133, "The character set, '%1!', is invalid since it 
738                           ** is not defined in Syscharsets."
739                           */
740                           raiserror 18133, @configvalue2
741                           return (1)
742                       end
743                   end
744               end
745   
746               else
747               if @confignum = 131
748               begin
749                   /* get current default sortord id */
750                   select @value = value from
751                       master.dbo.sysconfigures
752                   where config = 123
753   
754                   select @sorder_chset_id = @value
755                   if @configvalue2 is not NULL
756                   begin
757                       /*
758                       ** Get default sortorder id from name and
759                       ** validate the sortord id.
760                       */
761                       select @value = id
762                       from master..syscharsets
763                       where name = @configvalue2
764                           and type between 2000 and 2999
765   
766                       if @value is null
767                       begin
768                           /* 18134, "The sortorder, '%1!', is invalid since it 
769                           ** is not defined in Syscharsets."
770                           */
771                           raiserror 18134, @configvalue2
772                           return (1)
773                       end
774                   end
775               end
776   
777               /*
778               ** If an attempt to enable a disk mirroring is made, and
779               ** if this happens to be a server with HA services turned
780               ** on, we disallow. Currently we do not support ASE HA
781               ** services along with sybase mirroring.
782               */
783               if (@confignum = 140 and @configvalue = 0)
784               begin
785                   select @cmpstate = @@cmpstate
786                   if @cmpstate >= 0
787                   begin
788                       /* 18816 Mirroring not allowed in ASE HA */
789                       raiserror 18816
790                       return (1)
791                   end
792               end
793   
794               /*
795               ** If an attempt to disable disk mirroring is being made,
796               ** ensure that there are no devices that are currently
797               ** being mirrored.
798               */
799               else
800               if (@confignum = 140 and @configvalue = 1)
801               begin
802                   if (select count(*) from master.dbo.sysdevices
803                           where status & 512 = 512) > 0
804                   begin
805   
806                       /* 18750, Unable to disable disk mirroring
807                       ** because some devices are currently
808                       ** mirrored. Use 'disk unmirror' to
809                       ** unmirror these devices and then
810                       ** re-run this sp_configure command.
811                       */
812   
813                       raiserror 18570
814                       return (1)
815                   end
816               end
817   
818               /* 
819               **  If this is the number of current audit table we want
820               **  to make sure that if "with truncate" option is not 
821               **  provided new table is empty other wise fail.
822               */
823               else
824               if @confignum = 260
825               begin
826                   if @configvalue2 is not NULL
827                   begin
828                       if (@configvalue2 not in ("with truncate",
829                                   "default"))
830                       begin
831                           /*
832                           ** 18549, "Invalid third argument
833                           **         supplied: '%1!'. Valid
834                           **	   choices are 'with truncate'
835                           **	   or 'default'."
836                           */
837                           raiserror 18549, @configvalue2
838                           return (1)
839                       end
840                   end
841                   else
842                   begin
843                       select @value = 2
844                   end
845               end
846   
847               /*
848               ** global cache partition number
849               */
850               else
851               if @confignum = 337
852                   and @configvalue is not NULL
853               begin
854                   select @rec_state = @@recovery_state
855                   if (@rec_state not like "NOT_IN_RECOVERY%")
856                   begin
857                       raiserror 19106
858                       return (1)
859                   end
860   
861                   /*
862                   ** Partition number must be a power of 2
863                   ** between 1 and 256.
864                   */
865                   if (@configvalue not between 1 and 256)
866                       or (@configvalue & (@configvalue - 1) != 0)
867                   begin
868                       raiserror 18611
869                       return (1)
870                   end
871               end
872   
873               /*
874               ** If this is to change the number of maximum concurrently
875               ** recovered dbs, check to make sure that the server is
876               ** not currently in the tuning process. We don't allow
877               ** change to this config parameter if the server is in
878               ** tuning process.
879               ** If the server is still in recovery process, the only value
880               ** that the config parameter may be changed to is 1, which is
881               ** to change back to do serial recovery.
882               */
883               else
884               if @confignum = 415
885               begin
886                   select @rec_state = @@recovery_state
887                   if (@rec_state like "RECOVERY_TUNING%")
888                   begin
889                       raiserror 19107
890                       return (1)
891                   end
892                   else if (@rec_state not like "NOT_IN_RECOVERY%" and
893                           @configvalue != 1)
894                   begin
895                       raiserror 19108, @configvalue
896                       return (1)
897                   end
898   
899               end
900   
901               /*
902               ** If the config parameter is "global async prefetch limit",
903               ** do not allow this change if server is in recovery process.
904               */
905               else
906               if @confignum = 303
907               begin
908                   select @rec_state = @@recovery_state
909                   if (@rec_state not like "NOT_IN_RECOVERY%")
910                   begin
911                       raiserror 19109
912                       return (1)
913                   end
914               end
915   
916               /*
917               ** If configure parameter is "enable real time messaging",
918               ** check @configvalue2
919               **
920               **	- null means enable for all supported messaging
921               **	  on that platform.
922               **	- 'TIB_JMS' means enable/disable for TIBJMS only.
923               **	- 'IBM_MQ' means enable/disable for IBM MQ only.
924               **	- 'EAS_JMS' means enable/disable for EASJMS only.
925               **  	- 'SONICMQ_JMS' means enable for SONICMQ_JMS only.
926               **
927               ** @configvalue will be changed to a bit mask.
928               */
929               if (@value != 3) and (@confignum = 429)
930               begin
931                   if (@configvalue2 is not null)
932                   begin
933                       /* Get the class number */
934                       select @new_class = number
935                       from master.dbo.spt_values
936                       where lower(name) = lower(@configvalue2)
937                           and type = 'X'
938   
939                       /* Unrecognized provider class */
940                       if @@rowcount = 0
941                       begin
942                           raiserror 19416, @configvalue2
943                           return (1)
944                       end
945   
946                       /* Not a supported provider class */
947                       if (@new_class != 12) and (@new_class != 13)
948                           and (@new_class != 14) and (@new_class != 15)
949                       begin
950                           raiserror 19416, @configvalue2
951                           return (1)
952                       end
953                   end
954   
955                   /* Get the rtms provider mask */
956                   select @cfg_rtms_all_mask = number
957                   from master.dbo.spt_values
958                   where lower(name) = 'all providers'
959                       and type = 'RT'
960   
961                   select @all_rtms_provider_set = sum(number)
962                   from master.dbo.spt_values
963                   where type = 'RT'
964                       and low = 1
965                   select @all_rtms_provider_set = @all_rtms_provider_set
966                       + @cfg_rtms_all_mask
967   
968                   if (@configvalue2 is not null)
969                   begin
970                       select @cfg_rtms_provider_mask = number
971                       from master.dbo.spt_values
972                       where lower(name) = lower(@configvalue2)
973                           and type = 'RT'
974                           and low = 1
975                       /* Not a supported RTMS provider */
976                       if (@cfg_rtms_provider_mask is null)
977                       begin
978                           raiserror 19416, @configvalue2
979                           return (1)
980                       end
981                   end
982                   else if (@configvalue != 0)
983                   begin
984                       select @cfg_rtms_provider_mask = @cfg_rtms_all_mask
985                   end
986                   else
987                   begin
988                       select @cfg_rtms_provider_mask = @all_rtms_provider_set
989                   end
990               end
991   
992               /*
993               ** Raise warning messages if abstract plan 
994               ** dump/load/replace, literal autoparam or
995               ** statement cache are already on when 
996               ** compatibility mode is being enabled.
997               */
998               if (@confignum = 502 and @configvalue = 1)
999               begin
1000                  /* Raise warning message 19966 */
1001                  exec sp_getmessage 19966, @msg output
1002                  print @msg
1003  
1004                  /*
1005                  ** Raise warning message 19961 if abstract 
1006                  ** plan dump/load/replace is already on. 
1007                  */
1008                  if exists (select *
1009                          from master.dbo.sysconfigures
1010                          where config in (383, 384, 385)
1011                              and value = 1)
1012                  begin
1013                      exec sp_getmessage 19961, @msg output
1014                      print @msg
1015                  end
1016  
1017                  /*
1018                  ** Raise warning message 19967 if  
1019                  ** statement cache is already on. 
1020                  */
1021                  select @config_value_to_check = value
1022                  from master.dbo.sysconfigures
1023                  where config = 414
1024  
1025                  if (@config_value_to_check is not NULL
1026                          and @config_value_to_check != 0)
1027                  begin
1028                      exec sp_getmessage 19967, @msg output
1029                      print @msg, @config_value_to_check
1030  
1031                      /*
1032                      ** Raise warning message 19962 if  
1033                      ** literal autoparam is already on. 
1034                      */
1035                      if exists (select *
1036                              from master.dbo.sysconfigures
1037                              where config = 462
1038                                  and value = 1)
1039                      begin
1040                          exec sp_getmessage 19962, @msg output
1041                          print @msg
1042                      end
1043                  end
1044  
1045                  /*
1046                  ** Raise warning message if the value of  
1047                  ** histogram tuning factor is not 1, the   
1048                  ** default value in ASE 12.5. 
1049                  */
1050                  select @config_value_to_check = value
1051                  from master.dbo.sysconfigures
1052                  where config = 433
1053  
1054                  if (@config_value_to_check is not NULL
1055                          and @config_value_to_check != 1)
1056                  begin
1057                      exec sp_getmessage 19965, @msg output
1058                      print @msg, @config_value_to_check
1059                  end
1060  
1061              end
1062  
1063              /*
1064              ** Raise warning messages if compatibility mode 
1065              ** is already on when abstract plan dump/load/replace
1066              ** or literal autoparam is being enabled.
1067              */
1068              if exists (select *
1069                      from master.dbo.sysconfigures
1070                      where config = 502 and value = 1)
1071              begin
1072                  /*
1073                  ** Check if abstract plan dump/load/replace
1074                  ** is being enabled.
1075                  */
1076                  if ((@confignum = 383 or
1077                              @confignum = 384 or
1078                              @confignum = 385) and
1079                          @configvalue = 1)
1080                  begin
1081                      exec sp_getmessage 19961, @msg output
1082                      print @msg
1083                  end
1084  
1085                  /*
1086                  ** Check if literal autoparam is being enabled.
1087                  ** Note that literal autoparam itself is not
1088                  ** a problem but the combination of both
1089                  ** statement cache and literal autoparam will
1090                  ** have some effect. 
1091                  */
1092                  if (@confignum = 462 and @configvalue = 1)
1093                  begin
1094                      /* if statement cache is also on */
1095                      if exists (select *
1096                              from master.dbo.sysconfigures
1097                              where config = 414
1098                                  and value != 0)
1099                      begin
1100                          exec sp_getmessage 19962, @msg output
1101                          print @msg
1102                      end
1103                  end
1104  
1105                  /*
1106                  ** Check if statement cache is being enabled 
1107                  ** because we may have literal autoparam 
1108                  ** enabled already. In that case, we need to 
1109                  ** raise warning message for literal autoparam
1110                  ** as above too. 
1111                  */
1112                  if (@confignum = 414 and @configvalue != 0)
1113                  begin
1114                      /* if literal autoparam is already on */
1115                      if exists (select *
1116                              from master.dbo.sysconfigures
1117                              where config = 462
1118                                  and value = 1)
1119                      begin
1120                          exec sp_getmessage 19962, @msg output
1121                          print @msg
1122                      end
1123                  end
1124              end
1125  
1126              /* get @logical_memory */
1127              select @lmemconfignum = config
1128              from master.dbo.sysconfigures
1129              where name = 'total logical memory'
1130  
1131  
1132              select @logical_memory = value
1133              from master.dbo.syscurconfigs
1134              where config = @lmemconfignum
1135  
1136  
1137              select @unit = unit
1138              from master.dbo.syscurconfigs
1139              where config = @confignum
1140  
1141  
1142              /* optimizer level */
1143              if (@confignum = 507)
1144              begin
1145                  select @configvalue = number from master.dbo.spt_values
1146                  where type = 'OL' and name = @configvalue2
1147              end
1148              /*
1149              ** If configure value is 0, looking for the value
1150              ** in configvalue2. As "default character set id" and
1151              ** "default sortorder_id" can be changed together, if
1152              ** @configvalue is 0 in this case, we will get syntax
1153              ** error. So for such parameters where @unit is "id", 
1154              ** we will not check value of configvalue2.
1155              */
1156              if (@configvalue = 0
1157                      and @configvalue2 is not NULL
1158                      and @confignum != 507
1159                      and @configvalue2 not in ("default", "read", "write", "restore",
1160                          "verify", "with truncate"
1161  
1162                      )
1163                      and @unit not in ("name", "not applicable", "switch")
1164                      and (@unit != "id" or @confignum in (124, 168)))
1165              begin
1166                  /* convert "pPkKmMgG" to equivalent "k" units */
1167                  exec @status = sp_aux_getsize @configvalue2, @bvalue output
1168  
1169                  if @status = 0
1170                  begin
1171                      /* Invalid syntax */
1172                      return (1)
1173                  end
1174  
1175                  /* sp_aux_getsize returns value in K unit. */
1176                  /*
1177                  ** If we are updating "max memory" or "procedure cache size", 
1178                  ** do the conversion to 2k-pages ourselves
1179                  */
1180                  if @confignum in (146, 396)
1181                  begin
1182                      select @configvalue = @bvalue / 2
1183                  end
1184                  else
1185                  begin
1186                      select @bvalue = @bvalue * 1024
1187  
1188                      /* 
1189                      ** normalize it according to its unit and put
1190                      ** back to @configvalue. 
1191                      */
1192                      select @configvalue = config_admin(20,
1193                              @confignum, @bvalue, 0, NULL, NULL)
1194  
1195                      select @errnum = @@error
1196                      if ((@errnum = @permerr10331)
1197                              or (@errnum = @permerr10353)
1198                              or (@errnum = @permerr16802))
1199                      begin
1200                          return 1
1201                      end
1202  
1203                  end
1204              end
1205  
1206              /*
1207              **  If this is the number of default language, we want
1208              **  to make sure that the new value is a valid language
1209              **  ID in Syslanguages.
1210              */
1211              if @confignum = 124
1212              begin
1213                  if not exists (select *
1214                          from master.dbo.syslanguages
1215                          where langid = @configvalue)
1216                  begin
1217                      /* 0 is default language, us_english */
1218                      if @configvalue != 0
1219                      begin
1220                          /* 17414, "You can't set the default 
1221                          ** language to a language ID that is
1222                          ** not defined in Syslanguages."
1223                          */
1224                          raiserror 17414
1225                          return (1)
1226                      end
1227                  end
1228              end
1229  
1230  
1231              /*
1232              ** If this is the number of devices configuration
1233              ** parameter, we want to make sure that it's not being
1234              ** set to lower than the number of devices in sysdevices.
1235              */
1236              if @confignum = 116
1237              begin
1238                  /*
1239                  ** Get the number of devices.
1240                  */
1241                  select @numdevices = count(*)
1242                  from master.dbo.sysdevices
1243                  where status & 2 = 2
1244  
1245                  if (@configvalue < @numdevices)
1246                  begin
1247                      /* 17413, "The value of the 'number of 
1248                      ** devices' must not be less than the number
1249                      ** of active devices '%1!'
1250                      */
1251                      raiserror 17413, @numdevices
1252                      return (1)
1253                  end
1254              end
1255  
1256              /*
1257              ** Before changing the config value, if this parameter
1258              ** is "number of open databases", make sure it cannot
1259              ** be reduced during recovery.
1260              */
1261              if @confignum = 105
1262              begin
1263                  select @rec_state = @@recovery_state
1264                  if ((@rec_state not like "NOT_IN_RECOVERY%") and
1265                          (@configvalue < @oldcfgvalue))
1266                  begin
1267                      raiserror 19114
1268                      return (1)
1269                  end
1270              end
1271  
1272              /*
1273              ** Now we're done checking for @configvalue2 = "default", so
1274              ** we can modify it.  If this is a char param and @configvalue2
1275              ** is "default", reset it to be the actual default.
1276              */
1277              if @configvalue2 = "default"
1278                  and @oldcfgvalue_char is not null
1279              begin
1280                  select @configvalue2 = @defvalue
1281              end
1282  
1283              /*
1284              ** Check for parameter with integer and character datatype
1285              ** that if the new and old values for the configuration 
1286              ** parameter are same, then the value of configuration 
1287              ** parameter will not be changed. 
1288              */
1289              if ((@oldcfgvalue_char is NULL AND @configvalue = @oldcfgvalue)
1290                      OR (@oldcfgvalue_char is not NULL AND @configvalue2 = @oldcfgvalue_char))
1291              begin
1292                  /*
1293                  ** Now the old and new values for the first parameter
1294                  ** are same. But as "default sortorder id" and "default
1295                  ** character set id" both can be changed in sp_configure
1296                  ** together, check if the first parameter in sp_configure
1297                  ** is one of these and if the new and old values for the
1298                  ** second parameter are same, then value of both the
1299                  ** parameters should not be changed. The condition
1300                  ** mentioned below will always be true for other
1301                  ** configuration parameters or if only one configuration
1302                  ** parameter is given in sp_configure.
1303                  */
1304  
1305                  if (@confignum not in (123, 131)) OR
1306                      (@value = @sorder_chset_id)
1307                  begin
1308                      /* Set the @is_equal flag to true */
1309                      select @is_equal = 1
1310  
1311                  end
1312  
1313              end
1314  
1315  
1316  
1317              /*
1318              **If for 'enable real time messaging',  
1319              **We need to check the bitmap
1320              */
1321              if (@value != 3) and (@confignum = 429)
1322              begin
1323                  if (@oldcfgvalue = @cfg_rtms_all_mask)
1324                      select @tmp_rtms_value = @all_rtms_provider_set
1325                  else
1326                      select @tmp_rtms_value = @oldcfgvalue
1327  
1328                  select @tmp_rtms_value = @tmp_rtms_value & @cfg_rtms_provider_mask
1329                  /*
1330                  ** If @configvalue != 0, it means to enable RTDS. 
1331                  ** Set it as 1 
1332                  */
1333                  if (@configvalue != 0) and (@configvalue != 1)
1334                      select @configvalue = 1
1335  
1336                  if (@configvalue != 0) and (@tmp_rtms_value != 0)
1337                      select @is_equal = 1
1338                  else if (@configvalue = 0) and (@tmp_rtms_value = 0)
1339                      select @is_equal = 1
1340                  else
1341                      select @is_equal = 0
1342  
1343                  if (@is_equal = 1)
1344                      select @configvalue = @oldcfgvalue
1345              end
1346  
1347  
1348  
1349  
1350              /* 
1351              ** If the new and old values are not the same, call
1352              ** config_admin() to set the new value.  Otherwise just
1353              ** set @status = 1 (success).
1354              */
1355              if (@confignum != 543)
1356              begin
1357                  select @status = case
1358                          when (@is_equal = 1) then 1
1359                          else config_admin(@cmd, @confignum,
1360                                  @configvalue, @value,
1361  
1362                                  NULL,
1363  
1364                                  @configvalue2) end
1365  
1366                  select @errnum = @@error
1367                  if ((@errnum = @permerr10331)
1368                          or (@errnum = @permerr10353)
1369                          or (@errnum = @permerr16802))
1370                  begin
1371                      return 1
1372                  end
1373              end
1374              else
1375              begin
1376                  if (@is_equal = 1)
1377                  begin
1378                      select @status = 1
1379                  end
1380                  else
1381                  begin
1382                      /* 
1383                      ** If the config option is 'enable functionality group', 
1384                      ** do not dump the new config file at this point.  
1385                      */
1386                      select @cmd = 23
1387  
1388                      /* 
1389                      ** For each config option in group "Application 
1390                      ** Functionality", call config_admin() to turn 
1391                      ** each feature ON/OFF.  
1392                      */
1393                      declare appgroup_cursor cursor for
1394                      select config from master.dbo.sysconfigures
1395                      where parent = 49
1396                          and config != 543
1397  
1398                      open appgroup_cursor
1399                      fetch appgroup_cursor into @app_config
1400  
1401                      while (@@sqlstatus = 0)
1402                      begin
1403                          select @status = config_admin(@cmd, @app_config,
1404                                  @configvalue,
1405                                  @value,
1406  
1407                                  NULL,
1408  
1409                                  @configvalue2)
1410  
1411                          select @errnum = @@error
1412                          if ((@errnum = @permerr10331)
1413                                  or (@errnum = @permerr10353)
1414                                  or (@errnum = @permerr16802))
1415                          begin
1416  
1417                              close appgroup_cursor
1418                              deallocate cursor appgroup_cursor
1419                              return 1
1420                          end
1421  
1422                          fetch appgroup_cursor into @app_config
1423                      end
1424  
1425                      close appgroup_cursor
1426                      deallocate cursor appgroup_cursor
1427  
1428                      /* 
1429                      ** We have configured each feature in 'Application 
1430                      ** Functionality' group, now configure 'enable 
1431                      ** functionality group' with @cmd set to 1 so that 
1432                      ** we will dump a new config file.  
1433                      */
1434                      select @cmd = 1
1435                      select @status = config_admin(@cmd, @confignum,
1436                              @configvalue, @value,
1437  
1438                              NULL,
1439  
1440                              @configvalue2)
1441                      select @errnum = @@error
1442                      if ((@errnum = @permerr10331)
1443                              or (@errnum = @permerr10353)
1444                              or (@errnum = @permerr16802))
1445                      begin
1446                          return 1
1447                      end
1448                  end
1449              end
1450  
1451              /* if successful */
1452              if (@status = 1)
1453              begin
1454                  if (@confignum = 507)
1455                  begin
1456                      /* default value display data */
1457                      if (@configvalue = 999999)
1458                          select @optlevel_curr = @optlevel_def,
1459                              @optlevel_run = @optlevel_def
1460                      else
1461                          select @optlevel_curr = @configvalue2,
1462                              @optlevel_run = @configvalue2
1463                  end
1464  
1465                  /* Display the new value */
1466                  select "Parameter Name" = convert(char(30), name),
1467                      "Default" = CASE WHEN b.config = 507 THEN @optlevel_def
1468                          ELSE convert(char(11), space(11 - char_length(
1469                                      convert(varchar(11), defvalue))) +
1470                              convert(varchar(11), defvalue))
1471                      END,
1472                      "Memory Used" = convert(char(11), space(11 - char_length(
1473                              convert(varchar(11), c.comment))) +
1474                      convert(varchar(11), c.comment)),
1475                      "Config Value" = CASE WHEN b.config = 507 THEN @optlevel_curr
1476                          WHEN b.config = 565 THEN convert(char(255), +
1477                          isnull(b.value2, convert(char(255), b.value)))
1478                          ELSE convert(char(12), space(12 - char_length(
1479                                      isnull(b.value2, convert(char(32), b.value)))) +
1480                              isnull(b.value2, convert(char(32), b.value)))
1481                      END,
1482                      "Run Value" = CASE WHEN b.config = 507 THEN @optlevel_run
1483                          WHEN b.config = 565 THEN convert(char(255), +
1484                          isnull(c.value2, convert(char(255), c.value)))
1485                          ELSE convert(char(12), space(12 - char_length(
1486                                      isnull(c.value2, convert(char(32), c.value)))) +
1487                              isnull(c.value2, convert(char(32), c.value)))
1488                      END,
1489                      "Unit" = convert(char(20), c.unit),
1490                      "Type" = convert(char(20), c.type)
1491  
1492                  from master.dbo.sysconfigures b,
1493                      master.dbo.syscurconfigs c
1494                  where
1495                      b.config = @confignum and
1496  
1497                      b.config *= c.config
1498  
1499  
1500                  /*
1501                  ** If the configuration value and run value are equal
1502                  ** then display a message that there will not be any
1503                  ** change in configuration parameter and exit.
1504                  */
1505  
1506                  if (@is_equal = 1)
1507                  begin
1508                      if (@confignum = 507)
1509                      begin
1510                          select @configvalue2 = @optlevel_curr,
1511                              @oldcfgvalue_char = @optlevel_curr
1512                      end
1513                      /*
1514                      ** 18932, Resulting configuration value
1515                      ** and memory use have not changed from
1516                      ** previous values: new configuration
1517                      ** value %1!, previous configuration %2!
1518                      */
1519                      exec sp_getmessage 18932, @msg output
1520                      /* for integer datatype. */
1521                      if (@oldcfgvalue_char is NULL)
1522                      begin
1523                          print @msg, @configvalue, @oldcfgvalue
1524                      end
1525                      else
1526                      begin
1527                          /* for character datatype. */
1528                          print @msg, @configvalue2, @oldcfgvalue_char
1529                      end
1530                      return (0)
1531                  end
1532  
1533                  /*
1534                  ** Record the configure change for configuration
1535                  ** history auditing.  Config 259 is global auditing
1536                  ** option, and we record this in another place. See
1537                  ** the function cfg_notify_auditing().
1538                  */
1539                  if (@confignum != 259)
1540                  begin
1541                      select @cha_area = "SERVER"
1542                      select @cha_type = "sp_configure"
1543                      select @cha_target = NULL
1544                      select @cha_element = name
1545                      from master.dbo.sysconfigures
1546                      where config = @confignum
1547                      if @oldcfgvalue_char is NULL
1548                      begin
1549                          select @cha_oldvalue =
1550                              convert(varchar(255), @oldcfgvalue)
1551                          select @cha_newvalue =
1552                              convert(varchar(255), @configvalue)
1553                      end
1554                      else
1555                      begin
1556                          select @cha_oldvalue = @oldcfgvalue_char
1557                          select @cha_newvalue = @configvalue2
1558                      end
1559                      select @cha_mode = case
1560                              when (charindex("static", type) = 1)
1561                              then "static"
1562                              when (charindex("dynamic", type) = 1)
1563                              then "dynamic"
1564                              else NULL
1565                          end
1566                      from master.dbo.syscurconfigs
1567                      where config = @confignum
1568                      select @cha_instanceid = NULL
1569  
1570                      select @cha_ret = audit_config_history(
1571                              @cha_area,
1572                              @cha_type,
1573                              @cha_target,
1574                              @cha_element,
1575                              @cha_oldvalue,
1576                              @cha_newvalue,
1577                              @cha_mode,
1578                              @cha_instanceid)
1579                  end
1580  
1581                  /*
1582                  ** print reboot message if this option is not
1583                  ** dynamic.
1584                  */
1585                  if ((@sysstatus & 8) = 8)
1586                  begin
1587                      exec sp_getmessage 17419, @msg output
1588                      print @msg
1589                  end
1590                  else
1591                  begin
1592                      exec sp_getmessage 18123, @msg output
1593                      print @msg
1594                  end
1595                  /*
1596                  ** Lets us calculate @additional_memory i.e. the 
1597                  ** increase in 'total logical memory'
1598                  */
1599                  select @additional_memory =
1600                      (value - @logical_memory) * 2
1601                  from master.dbo.syscurconfigs
1602                  where config = @lmemconfignum
1603  
1604  
1605                  /*
1606                  ** print additional memory message 
1607                  */
1608                  if (@additional_memory > 0)
1609                  begin
1610                      /*
1611                      ** 18916, Changing the value of '%1!' to '%2!' 
1612                      ** increases the amount of memory ASE uses 
1613                      ** by %3! K.
1614                      */
1615                      if (@unit != "name")
1616                      begin
1617                          exec sp_getmessage 18916, @msg output
1618                          print @msg, @fullconfigname,
1619                              @configvalue, @additional_memory
1620                      end
1621                      else
1622                      begin
1623                          /* 
1624                          ** For configure options with name
1625                          ** as their units, they use 
1626                          ** configvalue2 (type of varchar)
1627                          ** to specify the intended value
1628                          ** insteading of configvalue (type
1629                          ** of int).
1630                          */
1631                          exec sp_getmessage 18916, @msg output
1632                          print @msg, @fullconfigname,
1633                              @configvalue2, @additional_memory
1634                      end
1635                  end
1636                  else if (@additional_memory < 0)
1637                  begin
1638                      /*
1639                      ** 18917, Changing the value of '%1!' to '%2!' 
1640                      ** reduces the amount of memory ASE uses 
1641                      ** by %3! K. The reduced memory may be
1642                      ** reused when this configure value changes,
1643                      ** but will not be released until ASE restarts.
1644                      */
1645                      select @additional_memory = @additional_memory * - 1
1646                      if (@unit != "name")
1647                      begin
1648                          exec sp_getmessage 18917, @msg output
1649                          print @msg, @fullconfigname,
1650                              @configvalue, @additional_memory
1651                      end
1652                      else
1653                      begin
1654                          exec sp_getmessage 18917, @msg output
1655                          print @msg, @fullconfigname,
1656                              @configvalue2, @additional_memory
1657                      end
1658                  end
1659                  else
1660                  begin
1661                      /*
1662                      ** 18397, Changing the value of '%1!'
1663                      ** does not increase the amount of 
1664                      ** memory Adaptive Server uses.
1665                      */
1666                      exec sp_getmessage 18397, @msg output
1667                      print @msg, @fullconfigname
1668                  end
1669  
1670                  return (0)
1671              end
1672              else
1673                  return (1)
1674          end
1675  
1676      end
1677  
1678      /*
1679      ** @configcount=0 implies @configname is not valid
1680      ** @configname=NULL implies displaying all the parameters except for
1681      ** the parameters with the config number equal to 19 or the parent equal
1682      ** to 19 since those parameters are displayed by sp_cacheconfig.
1683      */
1684      if (@configcount = 0)
1685      begin
1686          /* 18124, "No matching configuration options.  
1687          ** Here is a listing of groups:" 
1688          */
1689          raiserror 18124
1690          select distinct convert(char(50), name)
1691          from master.dbo.sysconfigures
1692          where config < 100
1693              and parent != 19
1694              and config != 19
1695          order by name
1696          return (1)
1697      end
1698      else if (@configname is NULL and @non_default_options is NULL)
1699      begin
1700  
1701          select @configname = "Config"
1702  
1703      end
1704  
1705      /*
1706      ** retrieve the display level from sysattributes
1707      */
1708      select @user_displaylevel = int_value from master.dbo.sysattributes where
1709          class = 4 AND
1710          attribute = 0 AND
1711          object_type = 'L' AND
1712          object = suser_id()
1713  
1714      /*
1715      ** set the default display level to 10 if it is not defined in sysattributes
1716      */
1717      if (@user_displaylevel is NULL)
1718          select @user_displaylevel = 10
1719  
1720      /*  
1721      ** If non_default_options is set, display only nondefault settings depending 
1722      ** on current display level and return
1723      */
1724      if (@non_default_options = 1)
1725      begin
1726          /* Display all config parameters for specified instance. */
1727          if @configvalue3 is not NULL
1728          begin
1729              if @configvalue3 != @@instancename
1730              begin
1731                  raiserror 19519, @configvalue3
1732                  return (1)
1733              end
1734              else
1735              begin
1736                  select Parameter_Name = convert(char(30), name),
1737                      Default_Value = convert(varchar(11), defvalue),
1738                      Memory_Used = convert(varchar(11), c.comment),
1739                      Config_Value = isnull(b.value2,
1740                          convert(char(32), b.value)),
1741                      Run_Value = isnull(c.value2,
1742                          convert(char(32), c.value)),
1743                      Unit = convert(char(20), c.unit),
1744                      Type_ = convert(char(10), c.type)
1745  
1746                  into #temptable1
1747                  from master.dbo.sysconfigures b,
1748                      master.dbo.syscurconfigs c
1749                  where
1750  
1751                      b.config = c.config
1752                      and (c.defvalue != isnull(b.value2,
1753                              convert(char(32), b.value))
1754                          or c.defvalue != isnull(c.value2,
1755                              convert(char(32), c.value)))
1756                      and c.config != 114
1757                      /* Exclude option 'configuration file' */
1758                      and c.type != "read-only"
1759                      and display_level <= @user_displaylevel
1760  
1761                  exec sp_autoformat #temptable1,
1762                      @selectlist = "'Parameter Name' = Parameter_Name,
1763  				'Default'= Default_Value,'Memory Used' = Memory_Used,
1764  				'Config Value '= Config_Value,'Run Value'= Run_Value,
1765  				
1766  				'Unit' = Unit,'Type'= Type_",
1767  
1768                      @orderby = "order by Parameter_Name"
1769                  return (0)
1770              end
1771          end
1772  
1773          if @@system_view = "instance"
1774          begin
1775              /*
1776              ** Display the information of the config parameter
1777              ** for the current instance as well as the cluster-wide
1778              ** one.
1779              */
1780              select Parameter_Name = convert(char(30), name),
1781                  Default_Value = convert(varchar(11), defvalue),
1782                  Memory_Used = convert(varchar(11), c.comment),
1783                  Config_Value = isnull(b.value2, convert(char(32), b.value)),
1784                  Run_Value = isnull(c.value2, convert(char(32), c.value)),
1785                  Unit = convert(char(20), c.unit),
1786                  Type_ = convert(char(10), c.type)
1787  
1788              into #temptable3
1789              from master.dbo.sysconfigures b,
1790                  master.dbo.syscurconfigs c
1791              where
1792  
1793                  b.config = c.config
1794                  and (c.defvalue != isnull(b.value2, convert(char(32), b.value))
1795                      or c.defvalue != isnull(c.value2, convert(char(32), c.value)))
1796                  and c.config != 114
1797                  /* Exclude option 'configuration file' */
1798                  and c.type != "read-only"
1799                  and display_level <= @user_displaylevel
1800  
1801              exec sp_autoformat #temptable3,
1802                  @selectlist = "'Parameter Name' = Parameter_Name, 
1803  			'Default'= Default_Value,'Memory Used' = Memory_Used, 
1804  			'Config Value '= Config_Value,'Run Value'= Run_Value, 
1805  
1806  			'Unit' = Unit,'Type'= Type_",
1807  
1808                  @orderby = "order by Parameter_Name"
1809          end
1810          else
1811          begin
1812              /* 
1813              ** When system_view is set to 'cluster', we need to
1814              ** display the config info across all instances. This
1815              ** includes two part: one is the cluster-wide config
1816              ** setting whose instanceid is NULL; the other
1817              ** part is the info for each instance who has a valid
1818              ** instanceid.
1819              */
1820              select distinct
1821                  Parameter_Name = convert(char(30), name),
1822                  Default_Value = convert(varchar(11), defvalue),
1823                  Memory_Used = convert(varchar(11), c.comment),
1824                  Config_Value = isnull(b.value2, convert(char(32), b.value)),
1825                  Run_Value = isnull(c.value2, convert(char(32), c.value)),
1826                  Unit = convert(char(20), c.unit),
1827                  Type_ = convert(char(10), c.type)
1828  
1829              into #temptable
1830              from master.dbo.sysconfigures b, master.dbo.syscurconfigs c
1831              where
1832  
1833                  b.config = c.config
1834                  and (c.defvalue != isnull(b.value2,
1835                          convert(char(32), b.value))
1836                      or c.defvalue != isnull(c.value2,
1837                          convert(char(32), c.value)))
1838                  and c.config != 114
1839                  /* Exclude option 'configuration file' */
1840                  and c.type != "read-only"
1841                  and display_level <= @user_displaylevel
1842  
1843  
1844  
1845              exec sp_autoformat #temptable,
1846                  @selectlist = "'Parameter Name' = Parameter_Name,
1847  			'Default'= Default_Value,'Memory Used' = Memory_Used,
1848  			'Config Value '= Config_Value,'Run Value'= Run_Value,
1849  
1850  			'Unit' = Unit,'Type'=Type_",
1851  
1852                  @orderby = "order by Parameter_Name"
1853          end
1854          return (0)
1855  
1856      end
1857  
1858      /*
1859      **      If @use_wildcard = 0 and the default sortorder is case-insensitive
1860      ** dictionary sort order, use exact match: name = @configname to get row,
1861      ** otherwise use wildcard match: name like "%" + @configname + "%".
1862      */
1863  
1864      if (@use_wildcard = 0 and @nocase = 1)
1865      begin
1866          select @confignum = config,
1867              @parent = config,
1868              @sysname = name,
1869              @sysstatus = status
1870          from master.dbo.sysconfigures
1871          where name = @configname
1872              and config != 19
1873      end
1874      else
1875      begin
1876          select @confignum = config,
1877              @parent = config,
1878              @sysname = name,
1879              @sysstatus = status
1880          from master.dbo.sysconfigures
1881          where name like "%" + @configname + "%"
1882              and config != 19
1883      end
1884  
1885      select @children = count(*)
1886      from master.dbo.sysconfigures
1887      where parent = @confignum
1888  
1889      if @children = 0
1890      begin
1891          /* @@nestlevel is problem area if a sproc calls sp_configure */
1892          /* could pass in another param when recursing */
1893          if @@nestlevel > 1
1894          begin
1895              /* reached a leaf, notify parent */
1896              return (1)
1897          end
1898          else
1899          begin
1900  
1901              begin
1902                  /* Display the information of the config parameter 
1903                  ** for the current server as well as the cluster-wide
1904                  ** one. Instanceid is NULL meaning this is the 
1905                  ** cluster-wide configuration.
1906                  */
1907                  select "Parameter Name" = convert(char(30), name),
1908                      "Default" = CASE WHEN b.config = 507 THEN @optlevel_def
1909                          ELSE convert(char(11), space(11 - char_length(
1910                                      convert(varchar(11), defvalue))) +
1911                              convert(varchar(11), defvalue))
1912                      END,
1913                      "Memory Used" = convert(char(11), space(11 - char_length(
1914                              convert(varchar(11), c.comment))) +
1915                      convert(varchar(11), c.comment)),
1916                      "Config Value" = CASE WHEN b.config = 507 THEN @optlevel_curr
1917                          WHEN b.config = 565 THEN convert(char(255), +
1918                          isnull(b.value2, convert(char(255), b.value)))
1919                          ELSE convert(char(12), space(12 - char_length(
1920                                      isnull(b.value2, convert(char(32), b.value)))) +
1921                              isnull(b.value2, convert(char(32), b.value)))
1922                      END,
1923                      "Run Value" = CASE WHEN b.config = 507 THEN @optlevel_run
1924                          WHEN b.config = 565 THEN convert(char(255), +
1925                          isnull(c.value2, convert(char(255), c.value)))
1926                          ELSE convert(char(12), space(12 - char_length(
1927                                      isnull(c.value2, convert(char(32), c.value)))) +
1928                              isnull(c.value2, convert(char(32), c.value)))
1929                      END,
1930                      "Unit" = convert(char(20), c.unit),
1931                      "Type" = convert(char(20), c.type)
1932  
1933                  from master.dbo.sysconfigures b,
1934                      master.dbo.syscurconfigs c
1935                  where
1936  
1937                      b.config *= c.config
1938                      and name like "%" + @configname + "%"
1939                      and b.config != 19
1940                      and parent != 19
1941              end
1942  
1943          end
1944  
1945          return (0)
1946      end
1947      else
1948      begin
1949          select @msg = "Group: " + @sysname
1950          print ""
1951          print @msg
1952          print ""
1953  
1954          /* this poor guy has kids, so recurse to leaves */
1955          declare config_curs cursor for
1956          select config, name, parent
1957          from master.dbo.sysconfigures
1958          where parent = @parent
1959          order by name
1960  
1961          open config_curs
1962  
1963          fetch config_curs into @sysconfig, @sysname, @sysparent
1964  
1965          while (@@sqlstatus = 0)
1966          begin
1967  
1968              execute @status = sp_configure @sysname
1969  
1970              if (@status = 1)
1971              begin
1972                  /*
1973                  ** this guy has leaves as kids,
1974                  ** so print out the leaves with
1975                  ** display level <= @user_displaylevel
1976                  ** Note: If a config parameter has more than one
1977                  ** parent, the extra parents are stored in
1978                  ** 'sysattribures'.
1979                  */
1980                  create table #configure_temp(config int)
1981  
1982                  insert into #configure_temp
1983                  select distinct a.config
1984                  from master.dbo.sysconfigures a,
1985                      master.dbo.syscurconfigs b
1986                  where
1987                      display_level <= @user_displaylevel
1988                      and parent = @parent
1989                      and a.config != 19
1990                      and a.config = b.config
1991  
1992                  union
1993                  select distinct config
1994                  from master.dbo.syscurconfigs,
1995                      master.dbo.sysattributes
1996                  where
1997                      display_level <= @user_displaylevel
1998                      and class = 4
1999                      and attribute = 1
2000                      and object_type = 'CP'
2001                      and int_value = @parent
2002                      and object = config
2003                      and config != 19
2004  
2005  
2006                  if exists (select * from #configure_temp)
2007                  begin
2008  
2009                      /*
2010                      ** If system_view is 'instance', display
2011                      ** the config info for the current instance
2012                      ** as well as the cluster-wide one.
2013                      */
2014  
2015                      begin
2016                          select
2017                              "Parameter Name" = convert(char(30), name),
2018                              "Default" = CASE WHEN b.config = 507
2019                                  THEN @optlevel_def
2020                                  ELSE convert(char(11),
2021                                      space(11 - char_length(
2022                                              convert(varchar(11), defvalue))) +
2023                                      convert(varchar(11), defvalue))
2024                              END,
2025                              "Memory Used" =
2026                              convert(char(11),
2027                              space(11 - char_length(
2028                                      convert(varchar(11), c.comment))) +
2029                              convert(varchar(11), c.comment)),
2030                              "Config Value" = CASE WHEN b.config = 507
2031                                  THEN @optlevel_curr
2032                                  ELSE convert(char(12),
2033                                      space(12 - char_length(
2034                                              isnull(b.value2,
2035                                                  convert(char(32), b.value)))) +
2036                                      isnull(b.value2,
2037                                          convert(char(32), b.value)))
2038                              END,
2039                              "Run Value" = CASE WHEN b.config = 507
2040                                  THEN @optlevel_run
2041                                  ELSE convert(char(12),
2042                                      space(12 - char_length(
2043                                              isnull(c.value2,
2044                                                  convert(char(32), c.value)))) +
2045                                      isnull(c.value2,
2046                                          convert(char(32), c.value)))
2047                              END,
2048                              "Unit" = convert(char(20), c.unit),
2049                              "Type" = convert(char(20), c.type)
2050  
2051                          from master.dbo.sysconfigures b,
2052                              master.dbo.syscurconfigs c
2053                          where b.config in
2054                                  (select config
2055                                  from #configure_temp)
2056                              and b.config = c.config
2057  
2058                          order by name
2059                      end
2060  
2061                  end
2062  
2063                  drop table #configure_temp
2064  
2065                  close config_curs
2066                  deallocate cursor config_curs
2067  
2068                  return (0)
2069              end
2070              else
2071              begin
2072                  /*
2073                  ** this lucky guy has grandkids, so, continue
2074                  */
2075                  fetch config_curs into
2076                      @sysconfig, @sysname, @sysparent
2077  
2078              end
2079          end
2080  
2081          close config_curs
2082          deallocate cursor config_curs
2083  
2084          return (0)
2085      end
2086  
2087  


exec sp_procxmode 'sp_configure', 'AnyMode'
go

Grant Execute on sp_configure to public
go
RESULT SETS
sp_configure_rset_006
sp_configure_rset_005
sp_configure_rset_004
sp_configure_rset_003
sp_configure_rset_002
sp_configure_rset_001

DEFECTS
 QJWI 5 Join or Sarg Without Index 314
 QJWI 5 Join or Sarg Without Index 469
 QJWI 5 Join or Sarg Without Index 546
 QJWI 5 Join or Sarg Without Index 564
 QJWI 5 Join or Sarg Without Index 1497
 QJWI 5 Join or Sarg Without Index 1937
 MEST 4 Empty String will be replaced by Single Space 360
 MEST 4 Empty String will be replaced by Single Space 362
 MEST 4 Empty String will be replaced by Single Space 435
 MEST 4 Empty String will be replaced by Single Space 1950
 MEST 4 Empty String will be replaced by Single Space 1952
 MINU 4 Unique Index with nullable columns master..sysattributes master..sysattributes
 MINU 4 Unique Index with nullable columns master..sysconfigures master..sysconfigures
 MINU 4 Unique Index with nullable columns master..syslanguages master..syslanguages
 MTYP 4 Assignment type mismatch @optlevel_def: varchar(11) = varchar(255) 257
 MTYP 4 Assignment type mismatch @optlevel_run: varchar(12) = varchar(255) 262
 MTYP 4 Assignment type mismatch @optlevel_curr: varchar(12) = varchar(255) 267
 MTYP 4 Assignment type mismatch @rec_state: varchar(30) = int 854
 MTYP 4 Assignment type mismatch @rec_state: varchar(30) = int 886
 MTYP 4 Assignment type mismatch @rec_state: varchar(30) = int 908
 MTYP 4 Assignment type mismatch @new_class: smallint = int 934
 MTYP 4 Assignment type mismatch @size_str: varchar(30) = varchar(255) 1167
 MTYP 4 Assignment type mismatch @rec_state: varchar(30) = int 1263
 MTYP 4 Assignment type mismatch @optlevel_curr: varchar(12) = varchar(255) 1461
 MTYP 4 Assignment type mismatch @optlevel_run: varchar(12) = varchar(255) 1462
 MUSP 4 Unquoted String Parameter sybsystemprocs..sp_autoformat: parameter # 1 363
 MUSP 4 Unquoted String Parameter sybsystemprocs..sp_autoformat: parameter # 1 1761
 MUSP 4 Unquoted String Parameter sybsystemprocs..sp_autoformat: parameter # 1 1801
 MUSP 4 Unquoted String Parameter sybsystemprocs..sp_autoformat: parameter # 1 1845
 QCSC 4 Costly 'select count()', use 'exists()' 802
 QPUI 4 Join or Sarg with Un-Rooted Partial Index Use SARG Candidate index: spt_values.spt_valuesclust clustered
(number, type)
Intersection: {type}
254
 QPUI 4 Join or Sarg with Un-Rooted Partial Index Use SARG Candidate index: spt_values.spt_valuesclust clustered
(number, type)
Intersection: {type}
936
 QPUI 4 Join or Sarg with Un-Rooted Partial Index Use SARG Candidate index: spt_values.spt_valuesclust clustered
(number, type)
Intersection: {type}
958
 QPUI 4 Join or Sarg with Un-Rooted Partial Index Use SARG Candidate index: spt_values.spt_valuesclust clustered
(number, type)
Intersection: {type}
963
 QPUI 4 Join or Sarg with Un-Rooted Partial Index Use SARG Candidate index: spt_values.spt_valuesclust clustered
(number, type)
Intersection: {type}
972
 QPUI 4 Join or Sarg with Un-Rooted Partial Index Use SARG Candidate index: spt_values.spt_valuesclust clustered
(number, type)
Intersection: {type}
1146
 QPUI 4 Join or Sarg with Un-Rooted Partial Index Use SARG Candidate index: sysconfigures.csysconfigures unique clustered
(name, parent, config)
Intersection: {parent}
1887
 QPUI 4 Join or Sarg with Un-Rooted Partial Index Use SARG Candidate index: sysconfigures.csysconfigures unique clustered
(name, parent, config)
Intersection: {parent}
1958
 QPUI 4 Join or Sarg with Un-Rooted Partial Index Use JOIN Candidate index: sysattributes.csysattributes unique clustered
(class, attribute, object_type, object, object_info1, object_info2, object_info3, object_cinfo)
Intersection: {object}
Uncovered: [object_info1, object_info2, object_info3, object_cinfo]
2002
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 259
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 264
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 269
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 283
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 293
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 300
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 315
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 316
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 340
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 354
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 386
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 406
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 438
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 446
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 447
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 453
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 454
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 471
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 472
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 513
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 514
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 544
 QTYP 4 Comparison type mismatch smallint = int 544
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 562
 QTYP 4 Comparison type mismatch smallint = int 562
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 586
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 692
 QTYP 4 Comparison type mismatch smallint = int 692
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 698
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 721
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 752
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 1023
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 1037
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 1052
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 1070
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 1097
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 1117
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 1134
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 1139
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 1215
 QTYP 4 Comparison type mismatch smallint = int 1215
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 1395
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 1396
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 1467
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 1475
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 1476
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 1482
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 1483
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 1495
 QTYP 4 Comparison type mismatch smallint = int 1495
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 1546
 QTYP 4 Comparison type mismatch smallint = int 1546
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 1567
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 1602
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 1692
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 1693
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 1694
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 1709
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 1710
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 1756
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 1796
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 1838
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 1872
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 1882
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 1887
 QTYP 4 Comparison type mismatch smallint = int 1887
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 1908
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 1916
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 1917
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 1923
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 1924
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 1939
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 1940
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 1958
 QTYP 4 Comparison type mismatch smallint = int 1958
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 1988
 QTYP 4 Comparison type mismatch smallint = int 1988
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 1989
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 1998
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 1999
 QTYP 4 Comparison type mismatch Comparison type mismatch: int vs smallint 2002
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 2003
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 2018
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 2030
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 2039
 TNOI 4 Table with no index master..syscurconfigs master..syscurconfigs
 TNOU 4 Table with no unique index master..spt_values master..spt_values
 CUNU 3 Cursor not updated: cursor should contain 'for read only' clause appgroup_cursor 1394
 CUNU 3 Cursor not updated: cursor should contain 'for read only' clause config_curs 1956
 MAW1 3 Warning message on %name% master..syscharsets.id: Warning message on syscharsets 730
 MAW1 3 Warning message on %name% master..syscharsets.id: Warning message on syscharsets 761
 MGTP 3 Grant to public master..spt_values  
 MGTP 3 Grant to public master..sysattributes  
 MGTP 3 Grant to public master..syscharsets  
 MGTP 3 Grant to public master..sysconfigures  
 MGTP 3 Grant to public master..syscurconfigs  
 MGTP 3 Grant to public master..sysdevices  
 MGTP 3 Grant to public master..syslanguages  
 MGTP 3 Grant to public sybsystemprocs..sp_configure  
 MLCH 3 Char type with length>30 char(32) 297
 MLCH 3 Char type with length>30 char(32) 298
 MLCH 3 Char type with length>30 char(32) 303
 MLCH 3 Char type with length>30 char(32) 304
 MLCH 3 Char type with length>30 char(255) 447
 MLCH 3 Char type with length>30 char(255) 448
 MLCH 3 Char type with length>30 char(32) 450
 MLCH 3 Char type with length>30 char(32) 451
 MLCH 3 Char type with length>30 char(255) 454
 MLCH 3 Char type with length>30 char(255) 455
 MLCH 3 Char type with length>30 char(32) 457
 MLCH 3 Char type with length>30 char(32) 458
 MLCH 3 Char type with length>30 char(255) 1476
 MLCH 3 Char type with length>30 char(255) 1477
 MLCH 3 Char type with length>30 char(32) 1479
 MLCH 3 Char type with length>30 char(32) 1480
 MLCH 3 Char type with length>30 char(255) 1483
 MLCH 3 Char type with length>30 char(255) 1484
 MLCH 3 Char type with length>30 char(32) 1486
 MLCH 3 Char type with length>30 char(32) 1487
 MLCH 3 Char type with length>30 char(50) 1690
 MLCH 3 Char type with length>30 char(32) 1740
 MLCH 3 Char type with length>30 char(32) 1742
 MLCH 3 Char type with length>30 char(32) 1753
 MLCH 3 Char type with length>30 char(32) 1755
 MLCH 3 Char type with length>30 char(32) 1783
 MLCH 3 Char type with length>30 char(32) 1784
 MLCH 3 Char type with length>30 char(32) 1794
 MLCH 3 Char type with length>30 char(32) 1795
 MLCH 3 Char type with length>30 char(32) 1824
 MLCH 3 Char type with length>30 char(32) 1825
 MLCH 3 Char type with length>30 char(32) 1835
 MLCH 3 Char type with length>30 char(32) 1837
 MLCH 3 Char type with length>30 char(255) 1917
 MLCH 3 Char type with length>30 char(255) 1918
 MLCH 3 Char type with length>30 char(32) 1920
 MLCH 3 Char type with length>30 char(32) 1921
 MLCH 3 Char type with length>30 char(255) 1924
 MLCH 3 Char type with length>30 char(255) 1925
 MLCH 3 Char type with length>30 char(32) 1927
 MLCH 3 Char type with length>30 char(32) 1928
 MLCH 3 Char type with length>30 char(32) 2035
 MLCH 3 Char type with length>30 char(32) 2037
 MLCH 3 Char type with length>30 char(32) 2044
 MLCH 3 Char type with length>30 char(32) 2046
 MNER 3 No Error Check should check @@error after select into 253
 MNER 3 No Error Check should check @@error after select into 350
 MNER 3 No Error Check should check @@error after insert 356
 MNER 3 No Error Check should check return value of exec 363
 MNER 3 No Error Check should check return value of exec 495
 MNER 3 No Error Check should check return value of exec 1001
 MNER 3 No Error Check should check return value of exec 1013
 MNER 3 No Error Check should check return value of exec 1028
 MNER 3 No Error Check should check return value of exec 1040
 MNER 3 No Error Check should check return value of exec 1057
 MNER 3 No Error Check should check return value of exec 1081
 MNER 3 No Error Check should check return value of exec 1100
 MNER 3 No Error Check should check return value of exec 1120
 MNER 3 No Error Check should check return value of exec 1519
 MNER 3 No Error Check should check return value of exec 1587
 MNER 3 No Error Check should check return value of exec 1592
 MNER 3 No Error Check should check return value of exec 1617
 MNER 3 No Error Check should check return value of exec 1631
 MNER 3 No Error Check should check return value of exec 1648
 MNER 3 No Error Check should check return value of exec 1654
 MNER 3 No Error Check should check return value of exec 1666
 MNER 3 No Error Check should check @@error after select into 1736
 MNER 3 No Error Check should check return value of exec 1761
 MNER 3 No Error Check should check @@error after select into 1780
 MNER 3 No Error Check should check return value of exec 1801
 MNER 3 No Error Check should check @@error after select into 1820
 MNER 3 No Error Check should check return value of exec 1845
 MNER 3 No Error Check should check @@error after insert 1982
 MUCO 3 Useless Code Useless Brackets 205
 MUCO 3 Useless Code Useless Brackets 231
 MUCO 3 Useless Code Useless Brackets 277
 MUCO 3 Useless Code Useless Brackets 319
 MUCO 3 Useless Code Useless Brackets 328
 MUCO 3 Useless Code Useless Brackets 364
 MUCO 3 Useless Code Useless Brackets 395
 MUCO 3 Useless Code Useless Brackets 409
 MUCO 3 Useless Code Useless Brackets 483
 MUCO 3 Useless Code Useless Brackets 498
 MUCO 3 Useless Code Useless Brackets 517
 MUCO 3 Useless Code Useless Brackets 525
 MUCO 3 Useless Code Useless Brackets 569
 MUCO 3 Useless Code Useless Brackets 582
 MUCO 3 Useless Code Useless Brackets 615
 MUCO 3 Useless Code Useless Brackets 621
 MUCO 3 Useless Code Useless Brackets 625
 MUCO 3 Useless Code Useless Brackets 643
 MUCO 3 Useless Code Useless Brackets 645
 MUCO 3 Useless Code Useless Brackets 647
 MUCO 3 Useless Code Useless Brackets 656
 MUCO 3 Useless Code Useless Brackets 657
 MUCO 3 Useless Code Useless Brackets 660
 MUCO 3 Useless Code Useless Brackets 661
 MUCO 3 Useless Code Useless Brackets 662
 MUCO 3 Useless Code Useless Brackets 671
 MUCO 3 Useless Code Useless Brackets 682
 MUCO 3 Useless Code Useless Brackets 710
 MUCO 3 Useless Code Useless Brackets 713
 MUCO 3 Useless Code Useless Brackets 741
 MUCO 3 Useless Code Useless Brackets 772
 MUCO 3 Useless Code Useless Brackets 783
 MUCO 3 Useless Code Useless Brackets 790
 MUCO 3 Useless Code Useless Brackets 800
 MUCO 3 Useless Code Useless Brackets 814
 MUCO 3 Useless Code Useless Brackets 828
 MUCO 3 Useless Code Useless Brackets 838
 MUCO 3 Useless Code Useless Brackets 855
 MUCO 3 Useless Code Useless Brackets 858
 MUCO 3 Useless Code Useless Brackets 869
 MUCO 3 Useless Code Useless Brackets 887
 MUCO 3 Useless Code Useless Brackets 890
 MUCO 3 Useless Code Useless Brackets 892
 MUCO 3 Useless Code Useless Brackets 896
 MUCO 3 Useless Code Useless Brackets 909
 MUCO 3 Useless Code Useless Brackets 912
 MUCO 3 Useless Code Useless Brackets 931
 MUCO 3 Useless Code Useless Brackets 943
 MUCO 3 Useless Code Useless Brackets 951
 MUCO 3 Useless Code Useless Brackets 968
 MUCO 3 Useless Code Useless Brackets 976
 MUCO 3 Useless Code Useless Brackets 979
 MUCO 3 Useless Code Useless Brackets 982
 MUCO 3 Useless Code Useless Brackets 998
 MUCO 3 Useless Code Useless Brackets 1025
 MUCO 3 Useless Code Useless Brackets 1054
 MUCO 3 Useless Code Useless Brackets 1076
 MUCO 3 Useless Code Useless Brackets 1092
 MUCO 3 Useless Code Useless Brackets 1112
 MUCO 3 Useless Code Useless Brackets 1143
 MUCO 3 Useless Code Useless Brackets 1156
 MUCO 3 Useless Code Useless Brackets 1172
 MUCO 3 Useless Code Useless Brackets 1196
 MUCO 3 Useless Code Useless Brackets 1225
 MUCO 3 Useless Code Useless Brackets 1245
 MUCO 3 Useless Code Useless Brackets 1252
 MUCO 3 Useless Code Useless Brackets 1264
 MUCO 3 Useless Code Useless Brackets 1268
 MUCO 3 Useless Code Useless Brackets 1289
 MUCO 3 Useless Code Useless Brackets 1323
 MUCO 3 Useless Code Useless Brackets 1343
 MUCO 3 Useless Code Useless Brackets 1355
 MUCO 3 Useless Code Useless Brackets 1358
 MUCO 3 Useless Code Useless Brackets 1367
 MUCO 3 Useless Code Useless Brackets 1376
 MUCO 3 Useless Code Useless Brackets 1401
 MUCO 3 Useless Code Useless Brackets 1412
 MUCO 3 Useless Code Useless Brackets 1442
 MUCO 3 Useless Code Useless Brackets 1452
 MUCO 3 Useless Code Useless Brackets 1454
 MUCO 3 Useless Code Useless Brackets 1457
 MUCO 3 Useless Code Useless Brackets 1506
 MUCO 3 Useless Code Useless Brackets 1508
 MUCO 3 Useless Code Useless Brackets 1521
 MUCO 3 Useless Code Useless Brackets 1530
 MUCO 3 Useless Code Useless Brackets 1539
 MUCO 3 Useless Code Useless Brackets 1560
 MUCO 3 Useless Code Useless Brackets 1562
 MUCO 3 Useless Code Useless Brackets 1585
 MUCO 3 Useless Code Useless Brackets 1608
 MUCO 3 Useless Code Useless Brackets 1615
 MUCO 3 Useless Code Useless Brackets 1636
 MUCO 3 Useless Code Useless Brackets 1646
 MUCO 3 Useless Code Useless Brackets 1670
 MUCO 3 Useless Code Useless Brackets 1673
 MUCO 3 Useless Code Useless Brackets 1684
 MUCO 3 Useless Code Useless Brackets 1696
 MUCO 3 Useless Code Useless Brackets 1698
 MUCO 3 Useless Code Useless Brackets 1717
 MUCO 3 Useless Code Useless Brackets 1724
 MUCO 3 Useless Code Useless Brackets 1732
 MUCO 3 Useless Code Useless Brackets 1769
 MUCO 3 Useless Code Useless Brackets 1854
 MUCO 3 Useless Code Useless Brackets 1864
 MUCO 3 Useless Code Useless Brackets 1896
 MUCO 3 Useless Code Useless Brackets 1945
 MUCO 3 Useless Code Useless Brackets 1965
 MUCO 3 Useless Code Useless Brackets 1970
 MUCO 3 Useless Code Useless Brackets 2068
 MUCO 3 Useless Code Useless Brackets 2084
 MUIN 3 Column created using implicit nullability 1980
 QAFM 3 Var Assignment from potentially many rows 257
 QAFM 3 Var Assignment from potentially many rows 262
 QAFM 3 Var Assignment from potentially many rows 267
 QAFM 3 Var Assignment from potentially many rows 508
 QAFM 3 Var Assignment from potentially many rows 538
 QAFM 3 Var Assignment from potentially many rows 557
 QAFM 3 Var Assignment from potentially many rows 584
 QAFM 3 Var Assignment from potentially many rows 690
 QAFM 3 Var Assignment from potentially many rows 696
 QAFM 3 Var Assignment from potentially many rows 719
 QAFM 3 Var Assignment from potentially many rows 750
 QAFM 3 Var Assignment from potentially many rows 934
 QAFM 3 Var Assignment from potentially many rows 956
 QAFM 3 Var Assignment from potentially many rows 970
 QAFM 3 Var Assignment from potentially many rows 1021
 QAFM 3 Var Assignment from potentially many rows 1050
 QAFM 3 Var Assignment from potentially many rows 1127
 QAFM 3 Var Assignment from potentially many rows 1132
 QAFM 3 Var Assignment from potentially many rows 1137
 QAFM 3 Var Assignment from potentially many rows 1145
 QAFM 3 Var Assignment from potentially many rows 1544
 QAFM 3 Var Assignment from potentially many rows 1559
 QAFM 3 Var Assignment from potentially many rows 1599
 QAFM 3 Var Assignment from potentially many rows 1708
 QAFM 3 Var Assignment from potentially many rows 1866
 QAFM 3 Var Assignment from potentially many rows 1876
 QCRS 3 Conditional Result Set 282
 QCRS 3 Conditional Result Set 437
 QCRS 3 Conditional Result Set 1466
 QCRS 3 Conditional Result Set 1690
 QCRS 3 Conditional Result Set 1907
 QCRS 3 Conditional Result Set 2016
 QCTC 3 Conditional Table Creation 350
 QCTC 3 Conditional Table Creation 1736
 QCTC 3 Conditional Table Creation 1780
 QCTC 3 Conditional Table Creation 1820
 QCTC 3 Conditional Table Creation 1980
 QDIS 3 Check correct use of 'select distinct' 1820
 QDIS 3 Check correct use of 'select distinct' 1983
 QDIS 3 Check correct use of 'select distinct' 1993
 QGWO 3 Group by/Distinct/Union without order by 1820
 QGWO 3 Group by/Distinct/Union without order by 1983
 QGWO 3 Group by/Distinct/Union without order by 1993
 QISO 3 Set isolation level 247
 QJWT 3 Join or Sarg Without Index on temp table 260
 QJWT 3 Join or Sarg Without Index on temp table 265
 QJWT 3 Join or Sarg Without Index on temp table 270
 QJWT 3 Join or Sarg Without Index on temp table 2053
 QNAJ 3 Not using ANSI Inner Join 258
 QNAJ 3 Not using ANSI Inner Join 263
 QNAJ 3 Not using ANSI Inner Join 268
 QNAJ 3 Not using ANSI Inner Join 487
 QNAJ 3 Not using ANSI Inner Join 1747
 QNAJ 3 Not using ANSI Inner Join 1789
 QNAJ 3 Not using ANSI Inner Join 1830
 QNAJ 3 Not using ANSI Inner Join 1984
 QNAJ 3 Not using ANSI Inner Join 1994
 QNAJ 3 Not using ANSI Inner Join 2051
 QNAM 3 Select expression has no name convert(char(50), name) 1690
 QNAO 3 Not using ANSI Outer Join 310
 QNAO 3 Not using ANSI Outer Join 465
 QNAO 3 Not using ANSI Outer Join 542
 QNAO 3 Not using ANSI Outer Join 560
 QNAO 3 Not using ANSI Outer Join 1492
 QNAO 3 Not using ANSI Outer Join 1933
 QNUA 3 Should use Alias: Column name should use alias #optlevel 257
 QNUA 3 Should use Alias: Table #optlevel 258
 QNUA 3 Should use Alias: Table master..syscurconfigs 258
 QNUA 3 Should use Alias: Column config should use alias syscurconfigs 259
 QNUA 3 Should use Alias: Column defvalue should use alias syscurconfigs 260
 QNUA 3 Should use Alias: Column number should use alias #optlevel 260
 QNUA 3 Should use Alias: Column name should use alias #optlevel 262
 QNUA 3 Should use Alias: Table #optlevel 263
 QNUA 3 Should use Alias: Table master..syscurconfigs 263
 QNUA 3 Should use Alias: Column config should use alias syscurconfigs 264
 QNUA 3 Should use Alias: Column number should use alias #optlevel 265
 QNUA 3 Should use Alias: Column value2 should use alias syscurconfigs 265
 QNUA 3 Should use Alias: Column name should use alias #optlevel 267
 QNUA 3 Should use Alias: Table #optlevel 268
 QNUA 3 Should use Alias: Table master..syscurconfigs 268
 QNUA 3 Should use Alias: Column config should use alias syscurconfigs 269
 QNUA 3 Should use Alias: Column number should use alias #optlevel 270
 QNUA 3 Should use Alias: Column value should use alias syscurconfigs 270
 QNUA 3 Should use Alias: Column name should use alias b 282
 QNUA 3 Should use Alias: Column defvalue should use alias c 286
 QNUA 3 Should use Alias: Column defvalue should use alias c 287
 QNUA 3 Should use Alias: Column parent should use alias b 316
 QNUA 3 Should use Alias: Column name should use alias a 437
 QNUA 3 Should use Alias: Column defvalue should use alias b 440
 QNUA 3 Should use Alias: Column defvalue should use alias b 441
 QNUA 3 Should use Alias: Column name should use alias a 470
 QNUA 3 Should use Alias: Column parent should use alias a 471
 QNUA 3 Should use Alias: Column name should use alias b 1466
 QNUA 3 Should use Alias: Column defvalue should use alias c 1469
 QNUA 3 Should use Alias: Column defvalue should use alias c 1470
 QNUA 3 Should use Alias: Column name should use alias b 1736
 QNUA 3 Should use Alias: Column defvalue should use alias c 1737
 QNUA 3 Should use Alias: Column display_level should use alias c 1759
 QNUA 3 Should use Alias: Column name should use alias b 1780
 QNUA 3 Should use Alias: Column defvalue should use alias c 1781
 QNUA 3 Should use Alias: Column display_level should use alias c 1799
 QNUA 3 Should use Alias: Column name should use alias b 1821
 QNUA 3 Should use Alias: Column defvalue should use alias c 1822
 QNUA 3 Should use Alias: Column display_level should use alias c 1841
 QNUA 3 Should use Alias: Column name should use alias b 1907
 QNUA 3 Should use Alias: Column defvalue should use alias c 1910
 QNUA 3 Should use Alias: Column defvalue should use alias c 1911
 QNUA 3 Should use Alias: Column name should use alias b 1938
 QNUA 3 Should use Alias: Column parent should use alias b 1940
 QNUA 3 Should use Alias: Column display_level should use alias b 1987
 QNUA 3 Should use Alias: Column parent should use alias a 1988
 QNUA 3 Should use Alias: Column config should use alias syscurconfigs 1993
 QNUA 3 Should use Alias: Table master..syscurconfigs 1994
 QNUA 3 Should use Alias: Table master..sysattributes 1995
 QNUA 3 Should use Alias: Column display_level should use alias syscurconfigs 1997
 QNUA 3 Should use Alias: Column class should use alias sysattributes 1998
 QNUA 3 Should use Alias: Column attribute should use alias sysattributes 1999
 QNUA 3 Should use Alias: Column object_type should use alias sysattributes 2000
 QNUA 3 Should use Alias: Column int_value should use alias sysattributes 2001
 QNUA 3 Should use Alias: Column config should use alias syscurconfigs 2002
 QNUA 3 Should use Alias: Column object should use alias sysattributes 2002
 QNUA 3 Should use Alias: Column config should use alias syscurconfigs 2003
 QNUA 3 Should use Alias: Column name should use alias b 2017
 QNUA 3 Should use Alias: Column defvalue should use alias c 2022
 QNUA 3 Should use Alias: Column defvalue should use alias c 2023
 QNUA 3 Should use Alias: Table #configure_temp 2055
 QPRI 3 Join or Sarg with Rooted Partial Index Use SARG Candidate index: sysconfigures.csysconfigures unique clustered
(name, parent, config)
Intersection: {name, parent}
339
 QPRI 3 Join or Sarg with Rooted Partial Index Use SARG Candidate index: sysconfigures.csysconfigures unique clustered
(name, parent, config)
Intersection: {name, parent}
353
 QPRI 3 Join or Sarg with Rooted Partial Index Use SARG Candidate index: sysconfigures.csysconfigures unique clustered
(name, parent, config)
Intersection: {name, parent}
385
 QPRI 3 Join or Sarg with Rooted Partial Index Use SARG Candidate index: sysconfigures.csysconfigures unique clustered
(name, parent, config)
Intersection: {name, parent}
405
 QPRI 3 Join or Sarg with Rooted Partial Index Use SARG Candidate index: sysconfigures.csysconfigures unique clustered
(name, parent, config)
Intersection: {name}
489
 QPRI 3 Join or Sarg with Rooted Partial Index Use SARG Candidate index: sysconfigures.csysconfigures unique clustered
(name, parent, config)
Intersection: {name}
1129
 QPRI 3 Join or Sarg with Rooted Partial Index Use SARG Candidate index: sysattributes.csysattributes unique clustered
(class, attribute, object_type, object, object_info1, object_info2, object_info3, object_cinfo)
Intersection: {object_type, object, attribute, class}
1709
 QSWV 3 Sarg with variable @confignum, Candidate Index: sysconfigures.nc2sysconfigures(config) F 544
 QSWV 3 Sarg with variable @confignum, Candidate Index: sysconfigures.nc2sysconfigures(config) F 562
 QSWV 3 Sarg with variable @confignum, Candidate Index: sysconfigures.nc2sysconfigures(config) F 692
 QSWV 3 Sarg with variable @confignum, Candidate Index: sysconfigures.nc2sysconfigures(config) F 1495
 QSWV 3 Sarg with variable @confignum, Candidate Index: sysconfigures.nc2sysconfigures(config) F 1546
 QSWV 3 Sarg with variable @parent, Candidate Index: sysconfigures.nc1sysconfigures(parent, config) F 1988
 QUNI 3 Check Use of 'union' vs 'union all' 1983
 VNRD 3 Variable is not read @whichone 212
 VNRD 3 Variable is not read @use_cluster 221
 VNRD 3 Variable is not read @instanceid 222
 VNRD 3 Variable is not read @dummy 652
 VNRD 3 Variable is not read @cha_ret 1570
 VNRD 3 Variable is not read @sysstatus 1879
 VUNU 3 Variable is not used @configcount2 143
 VUNU 3 Variable is not used @configcount3 144
 VUNU 3 Variable is not used @match_count2 145
 VUNU 3 Variable is not used @remote_instance_name 150
 VUNU 3 Variable is not used @remote_instance_id 152
 VUNU 3 Variable is not used @retstat 154
 VUNU 3 Variable is not used @sqlbuf 155
 CRDO 2 Read Only Cursor Marker (has an 'order by' clause) 1956
 CUPD 2 Updatable Cursor Marker (updatable by default) 1394
 MRST 2 Result Set Marker 282
 MRST 2 Result Set Marker 437
 MRST 2 Result Set Marker 1466
 MRST 2 Result Set Marker 1690
 MRST 2 Result Set Marker 1907
 MRST 2 Result Set Marker 2016
 MSUB 2 Subquery Marker 802
 MSUB 2 Subquery Marker 1008
 MSUB 2 Subquery Marker 1035
 MSUB 2 Subquery Marker 1068
 MSUB 2 Subquery Marker 1095
 MSUB 2 Subquery Marker 1115
 MSUB 2 Subquery Marker 1213
 MTR1 2 Metrics: Comments Ratio Comments: 37% 88
 MTR2 2 Metrics: Cyclomatic Complexity Cyclo: 178 = 221dec - 45exi + 2 88
 MTR3 2 Metrics: Query Complexity Complexity: 868 88
 PRED_QUERY_COLLECTION 2 {c=master..sysconfigures, c2=master..syscurconfigs} 0 485
 PRED_QUERY_COLLECTION 2 {c=master..syscurconfigs, c2=master..sysconfigures} 0 1736
 PRED_QUERY_COLLECTION 2 {c=master..sysconfigures, c2=master..syscurconfigs} 0 1780
 PRED_QUERY_COLLECTION 2 {c=master..syscurconfigs, c2=master..sysconfigures} 0 1820
 PRED_QUERY_COLLECTION 2 {c=master..syscurconfigs, c2=master..sysconfigures} 0 1983
 PRED_QUERY_COLLECTION 2 {a=master..sysattributes, c=master..syscurconfigs} 0 1993

DATA PROPAGATION detailed
ColumnWritten To
@configvalue2sp_configure_rset_001.Config Value °.Run Value sp_configure_rset_002.Config Value °.Run Value

DEPENDENCIES
PROCS AND TABLES USED
writes table tempdb..#temptable1 (1) 
read_writes table tempdb..#configure_temp (1) 
writes table sybsystemprocs..sp_configure_rset_004 
read_writes table tempdb..#optlevel (1) 
calls proc sybsystemprocs..sp_getmessage  
   reads table master..sysmessages (1)  
   reads table master..syslanguages (1)  
   reads table sybsystemprocs..sysusermessages  
   calls proc sybsystemprocs..sp_validlang  
      reads table master..syslanguages (1)  
writes table sybsystemprocs..sp_configure_rset_006 
calls proc sybsystemprocs..sp_configure  
reads table master..syslanguages (1)  
writes table sybsystemprocs..sp_configure_rset_003 
reads table master..sysdevices (1)  
writes table sybsystemprocs..sp_configure_rset_005 
calls proc sybsystemprocs..sp_aux_checkroleperm  
   reads table master..sysconfigures (1)  
   reads table master..syscurconfigs (1)  
writes table tempdb..#temptable3 (1) 
reads table master..sysconfigures (1)  
writes table tempdb..#temptab (1) 
writes table tempdb..#temptable (1) 
calls proc sybsystemprocs..sp_aux_getsize  
reads table master..syscurconfigs (1)  
reads table master..spt_values (1)  
reads table master..syscharsets (1)  
reads table master..sysattributes (1)  
writes table sybsystemprocs..sp_configure_rset_001 
writes table sybsystemprocs..sp_configure_rset_002 
calls proc sybsystemprocs..sp_autoformat  
   reads table tempdb..systypes (1)  
   reads table tempdb..syscolumns (1)  
   writes table sybsystemprocs..sp_autoformat_rset_003 
   read_writes table tempdb..#colinfo_af (1) 
   reads table master..systypes (1)  
   writes table sybsystemprocs..sp_autoformat_rset_004 
   calls proc sybsystemprocs..sp_autoformat  
   calls proc sybsystemprocs..sp_namecrack  
   writes table sybsystemprocs..sp_autoformat_rset_002 
   reads table master..syscolumns (1)  
   writes table sybsystemprocs..sp_autoformat_rset_005 
   writes table sybsystemprocs..sp_autoformat_rset_001 

CALLERS
called by proc sybsystemprocs..sp_configure  
called by proc sybsystemprocs..sp_setlockpromote  
   called by proc sybsystemprocs..sp_setrowlockpromote  
   called by proc sybsystemprocs..sp_setpglockpromote  
called by proc sybsystemprocs..sp_downgrade_esd