DatabaseProcApplicationCreatedLinks
sybsystemprocssp_maplogin  14 déc. 14Defects Propagation Dependencies

1     
2     /* Sccsid = "%Z% generic/sproc/src/%M% %I% %G%" */
3     
4     /*
5     ** Messages for "sp_maplogin"    
6     **
7     ** 17260, "Can't run '%1!' from within a transaction."
8     ** 17869, "Stored procedure %1 failed because %2 failed in database %3."
9     ** 18294, "User '%1!' is not a local user -- request denied."
10    ** 18388, "You must be in the master database in order to run '%1'!."
11    ** 18409, "The built-in function getdbrepstat() failed."
12    ** 18773, "HA_LOG: HA consistency check failure in '%1!' on the companion server '%2!'"
13    ** 18778, "Unable to find login '%1!' with id '%2!' in syslogins."
14    ** 19257, "The authentication mechanism '%1!' is not valid."
15    ** 19256, "Client authentication mapping updated."
16    ** 19259, "Warning. Authentication mechanism '%1!' is not enabled."
17    ** 19445, "External name '%1!' is already a local login -- map request denied."
18    ** 19447, "User '%1!' allows only '%2!' authentication mechanism to be used -- request denied."
19    ** 19450, "A mapping with authentication mechanism '%1!' is not allowed, only action 'drop' is permitted."
20    ** 19453, "Cannot define a mapping for ALL authentications and ALL logins -- map request denied.
21    ** 19940, "Client authentication mapping overwritten. Previous values were @authentication_mech='%1!', @client_name='%2!' and @login_name='%3!'.
22    */
23    
24    /* 
25    ** IMPORTANT: Please read the following instructions before
26    **   making changes to this stored procedure.
27    **
28    **	To make this stored procedure compatible with High Availability (HA),
29    **	changes to certain system tables must be propagated 
30    **	to the companion server under some conditions.
31    **	The tables include (but are not limited to):
32    **		syslogins, sysservers, sysattributes, systimeranges,
33    **		sysresourcelimits, sysalternates, sysdatabases,
34    **		syslanguages, sysremotelogins, sysloginroles,
35    **		sysalternates (master DB only), systypes (master DB only),
36    **		sysusers (master DB only), sysprotects (master DB only)
37    **	please refer to the HA documentation for detail.
38    **
39    **	Here is what you need to do: 
40    **	For each insert/update/delete statement, add three sections to
41    **	-- start HA transaction prior to the statement
42    **	-- add the statement
43    **	-- add HA synchronization code to propagate the change to the companion
44    **
45    **	For example, if you are adding 
46    **		insert master.dbo.syslogins ......
47    **	the code should look like:
48    **	1. Now, the SQL statement:
49    **		insert master.dbo.syslogins ......
50    **	2. Add a HA synchronization section right after the SQL statement:
51    **		
52    **
53    **	You may need to do similar change for each built-in function you
54    **	want to add.
55    */
56    
57    create or replace procedure sp_maplogin
58        @authmethod varchar(30) = NULL, /* Authentication mechanism */
59        @externname varchar(255) = NULL, /* client user name */
60        @loginame varchar(255) = NULL /* user's local name */
61    AS
62        BEGIN
63    
64            DECLARE @msg varchar(1024),
65                @authid int,
66                @any_authid int, /* LOGIN_ANY auth id */
67                @syslog_authid int, /* syslogin auth id */
68                @syslog_authmch varchar(30), /* syslogin auth mech name */
69                @suid int,
70                @login_class smallint, /* omni's attribute  class */
71                @attrib smallint, /* attr. id for ext. login */
72                @action smallint,
73                @dummy int,
74                @HA_CERTIFIED tinyint, /* Is the SP HA certified ? */
75                @retstat int,
76                @config int,
77                @del int,
78                @auth_mech varchar(30),
79                @client_name varchar(255),
80                @login_name varchar(255),
81                @dbname varchar(255), /* for logexec error message */
82                @master_is_rep int, /* whether master db is replicated */
83                @nullarg char(1),
84                @status int,
85                @gp_enabled int
86    
87    
88    
89            /* 
90            ** If granular permissions is not enabled then sso_role is required.
91            ** If granular permissions is enabled then the permission 'manage any login' is
92            ** required.  proc_role and proc_auditperm will also do auditing
93            ** if required. Both will also print error message if required.
94            */
95    
96            select @nullarg = NULL
97            execute @status = sp_aux_checkroleperm "sso_role", "manage any login",
98                @nullarg, @gp_enabled output
99    
100           /* For Auditing */
101           if (@gp_enabled = 0)
102           begin
103               if (proc_role("sso_role") = 0)
104                   return (1)
105           end
106           else
107           begin
108               select @dummy = proc_auditperm("manage any login", @status)
109           end
110   
111           if (@status != 0)
112               return (1)
113   
114           select @HA_CERTIFIED = 0
115           select @retstat = 0
116   
117   
118   
119           /* check to see if we are using HA specific SP for a HA enabled server */
120           exec @retstat = sp_ha_check_certified 'sp_maplogin', @HA_CERTIFIED
121           if (@retstat != 0)
122               return (1)
123   
124           /*
125           ** If we are logging this system procedure for replication,
126           ** we must be in the 'master' database to avoid creating a
127           ** multi-database transaction which could make recovery of
128           ** the 'master' database impossible.
129           */
130           select @master_is_rep = getdbrepstat(1)
131   
132           if (@master_is_rep < 0)
133           begin
134               /*
135               ** 18409, "The built-in function getdbrepstat() failed."
136               */
137               raiserror 18409, "getdbrepstat"
138               return (1)
139           end
140   
141           select @dbname = db_name()
142   
143           if (@master_is_rep > 0) and (@dbname != "master")
144           begin
145               /*
146               ** 18388, "You must be in the master database in order
147               ** to run '%1!'."
148               */
149               raiserror 18388, "sp_maplogin"
150               return (1)
151           end
152   
153           /*
154           **  If we're in a transaction, disallow this since it might make recovery
155           **  impossible.
156           */
157           if @@trancount > 0
158           BEGIN
159               /*		
160               ** 17260 Can't run '%1!' from within a transaction.
161               */
162               raiserror 17260, "sp_maplogin"
163               return 1
164           END
165   
166           /* 
167           ** We cannot define any mapping for all authentications
168           ** and all logins
169           */
170           if ((@authmethod is null or upper(@authmethod) = 'ANY')
171                   and (@externname is null or upper(@externname) = 'ANY'))
172           BEGIN
173               /*		
174               ** 19453  "Cannot define a mapping for ALL authentications 
175               ** and ALL logins -- map request denied.
176               */
177               raiserror 19453
178               return 1
179           END
180   
181           /*
182           ** Check that the auth method is valid. NULL means ALL.
183           */
184           if (@authmethod is null)
185               select @authmethod = 'ANY'
186   
187           /*
188           ** Check whether authentication mechanism specified is valid or not.
189           ** 'AUTH_DEFAULT' and 'AUTH_MASK' are new values added in spt_values
190           ** used to obtain value of default ('ANY') authmech or authentication
191           ** mask respectively. They are not valid names that the user can
192           ** specify as authentication mechanism.
193           */
194           select @authid = low, @config = number
195           from master.dbo.spt_values
196           where type = 'ua' and upper(name) = upper(@authmethod)
197               and upper(name) not in ('AUTH_DEFAULT', 'AUTH_MASK')
198   
199           if @@rowcount = 0
200           BEGIN
201               /*		
202               ** 19257  "The authentication mechanism '%1!' is not valid .
203               */
204               raiserror 19257, @authmethod
205               return (1)
206           END
207   
208           /*
209           ** Check that the authentication method is enabled. The configuration option
210           ** is in spt_values.number.
211           ** For SMP or SDC, look up syscurconfigs for local instance.
212           */
213           if (@config != 0) and not exists (select 1
214                   from master.dbo.syscurconfigs a
215   
216                   where a.config = @config and a.value != 0)
217   
218           BEGIN
219               /*
220               ** 19259, "Warning. Authentication mechanism '%1!' is not enabled."
221               */
222               exec sp_getmessage 19259, @msg output
223               print @msg, @authmethod
224           END
225   
226           select @del = 0
227   
228           /*
229           ** Check the login name/action
230           */
231           if upper(@loginame) = 'CREATE LOGIN'
232               select @suid = - 3
233           else if (upper(@loginame) = 'DROP')
234               select @del = 1
235           else
236           BEGIN
237               /*
238               ** Check that the @loginame is valid.
239               */
240               /*
241               **  Set a mask with all the authentication bits using
242               ** 'AUTH_MASK'
243               */
244               select @any_authid = low
245               from master.dbo.spt_values
246               where type = 'ua' and upper(name) = 'AUTH_MASK'
247   
248               select @suid = suid, @syslog_authid = (status & @any_authid)
249               from master.dbo.syslogins
250               where name = @loginame
251                   and ((status & 512) != 512) /* not LOGIN PROFILE */
252               if @@rowcount = 0
253               BEGIN
254                   /*		
255                   ** 18294 "User '%1!' is not a local user -- 
256                   ** request denied."
257                   */
258                   raiserror 18294, @loginame
259                   return (1)
260               END
261   
262               /* authid of 0 means ANY, set it the local var to this value. */
263               if @syslog_authid = 0
264                   select @syslog_authid = @any_authid
265   
266               /*
267               **  Check the authentication mechanism for a login and authentication
268               **  mechanism parameter to sp_maplogin do not conflict.  There should
269               **  be at least one bit matching in the two masks representing the
270               **  authentication mechanism.
271               **
272               **  The bitmask for auth mech NONE/NULL has already been mapped to ANY.
273               */
274   
275               if (@syslog_authid & @authid) = 0
276               BEGIN
277                   select @syslog_authmch = name
278                   from master.dbo.spt_values
279                   where type = 'ua' and low = @syslog_authid
280                       and upper(name) not in ('AUTH_DEFAULT',
281                           'AUTH_MASK')
282                   /*		
283                   ** 19447 "User '%1!' allows only '%2!' authentication 
284                   ** mechanism to be used -- request denied."
285                   */
286                   raiserror 19447, @loginame, @syslog_authmch
287                   return (1)
288               END
289           END
290   
291           if (@externname is null or upper(@externname) = 'ANY')
292           BEGIN
293               select @externname = '*'
294           END
295   
296           if (@externname != '*' and @del = 0)
297           BEGIN
298               /*
299               **  Check that an explicit value of @externname is not already a local login
300               **  or login profile
301               */
302               if exists (select 1
303                       from master.dbo.syslogins
304                       where name = @externname)
305               BEGIN
306                   /*		
307                   ** 19445 "External name '%1!' is already a local 
308                   ** login -- map request denied."
309                   */
310                   raiserror 19445, @externname
311                   return (1)
312               END
313           END
314           /*
315           ** Check if the ASE authentication mechanism is used for the mapping.
316           ** New behavior in ASE 12.5.4 prevents local logins from being mapped
317           ** to other local logins, making most actions with ASE auth mech invalid.
318           ** The only allowed action allowed for ASE is 'drop', to aid in removing any
319           ** mappings that may have been added in earlier releases.
320           */
321           if (upper(@authmethod) = "ASE") and (@del = 0)
322           BEGIN
323               /*		
324               ** 19450  "A mapping with authentication mechanism '%1!' is
325               ** not allowed, only action 'drop' is permitted."
326               */
327               raiserror 19450, @authmethod
328               return (1)
329           END
330           /*
331           ** The mapping is stored in sysattributes. The entries for external
332           ** authentication mechanisms are as follows:
333           **
334           **	- class:	20
335           **	- attribute:	0
336           **	- object:	mapped suid
337           **			- It may have a real suid or,
338           **			- INVALID_SUID (-2), to map using the external name.
339           **			- CRTLOGIN_SUID (-3), to create login if it does not
340           **			  exist.
341           **	- object_cinfo:	external name, or '*' for all external names.
342           **	- object_info1: authentication mechanism. If we map any authentication
343           **			it will contain LOGIN_ALL, that is an OR of all the
344           **			existing authentication mechinsms.
345           **
346           ** If there is already an entry for that external user, we'll update
347           ** it, else we'll insert a new row.
348           ** For each user only one authentication mechanism is allowed. However,
349           ** when setting a generic map (extern user name is null), there can
350           ** be multiple entries for it. We can specify that all the users using
351           ** PAM will be mapped as u1, all users using LDAP will be mapped
352           ** u2, etc.
353           */
354           select @login_class = 20, @attrib = 0
355   
356           /*
357           ** Check whether a mapping already exists. If it does, update it
358           ** or delete it, depending on the parameter @delete.
359           ** If the client user name is null, we will look for a mapping for
360           ** all users with the authentication method specified.
361           ** If the client user name is not null, we will look for a mapping
362           ** for this user.
363           */
364           if ((@externname = '*' and
365                       exists (select * from master.dbo.sysattributes where
366                               class = @login_class and attribute = @attrib and
367                               object_cinfo = '*' and
368                               object_info1 = @authid))
369                   or (@externname != '*' and
370                       exists (select * from master.dbo.sysattributes where
371                               class = @login_class and attribute = @attrib and
372                               object_cinfo = @externname)))
373           BEGIN
374               if (@del = 0)
375                   select @action = 2 /* update attribute */
376               else
377                   select @action = 3 /* delete attribute */
378           END
379           else
380           BEGIN
381               if (@del = 0)
382                   select @action = 1 /* insert attribute */
383               else
384                   /* Nothing to delete. */
385                   return (0)
386           END
387   
388           /*
389           ** First validate the row. 
390           */
391           if attrib_valid(@login_class, @attrib, "LM", @suid, @authid, NULL, NULL,
392                   @externname, NULL, NULL, NULL, NULL, NULL, @action) = 0
393           BEGIN
394               return (1)
395           END
396   
397           /* 
398           ** This transaction also writes a log record for replicating the
399           ** invocation of this procedure. If logexec() fails, the transaction
400           ** is aborted.
401           **
402           ** IMPORTANT: The name rs_logexec is significant and is used by
403           ** Adaptive Server.
404           */
405           begin tran rs_logexec
406   
407   
408   
409           /*
410           ** Now insert/update/delete the row
411           */
412           if @action = 1
413           BEGIN
414               insert into master.dbo.sysattributes(class, attribute,
415                   object_type, object_info1, object, object_cinfo,
416                   image_value, object_info2)
417               values (@login_class, @attrib, "LM", @authid, @suid,
418                   @externname, null, null)
419   
420               if (@@error != 0)
421                   goto clean_all
422   
423               /*
424               ** 19256 "Client authentication mapping updated."
425               */
426               exec sp_getmessage 19256, @msg output
427               print @msg
428           END
429           else if @action = 2
430           BEGIN
431               if (@externname = '*')
432               BEGIN
433                   /* 
434                   ** Select the previous mapping information to be 
435                   ** displayed in the message before updating the row.
436                   */
437                   select @auth_mech = isnull(s.name, "ANY"),
438                       @client_name =
439                       case object_cinfo
440                           when '*' then "ANY"
441                           else object_cinfo
442                       end,
443                       @login_name =
444                       case object
445                           when - 2 then "ANY"
446                           when - 3 then "CREATE LOGIN"
447                           else isnull(suser_name(object), "NO MAP")
448                       end
449                   from master.dbo.sysattributes, master.dbo.spt_values s
450                   where class = @login_class and attribute = @attrib and
451                       (object_info1 = s.low) and
452                       (s.name not in ('AUTH_MASK')) and
453                       (s.type = 'ua') and
454                       object_cinfo = '*' and object_info1 = @authid
455   
456                   update master.dbo.sysattributes
457                   set object = @suid
458                   where class = @login_class and attribute = @attrib and
459                       object_cinfo = '*' and
460                       object_info1 = @authid
461               END
462               else
463               BEGIN
464                   /*
465                   ** Select the previous mapping information to be
466                   ** displayed in the message before updating the row.
467                   */
468                   select @auth_mech = isnull(s.name, "ANY"),
469                       @client_name =
470                       case object_cinfo
471                           when '*' then "ANY"
472                           else object_cinfo
473                       end,
474                       @login_name =
475                       case object
476                           when - 2 then "ANY"
477                           when - 3 then "CREATE LOGIN"
478                           else isnull(suser_name(object), "NO MAP")
479                       end
480                   from master.dbo.sysattributes, master.dbo.spt_values s
481                   where class = @login_class and attribute = @attrib and
482                       (object_info1 = s.low) and
483                       (s.name not in ('AUTH_MASK')) and
484                       object_cinfo = @externname
485   
486                   update master.dbo.sysattributes
487                   set object = @suid, object_info1 = @authid
488                   where class = @login_class and
489                       attribute = @attrib and
490                       object_cinfo = @externname
491               END
492   
493               if (@@error != 0)
494                   goto clean_all
495   
496               /*
497               ** 19940 "Client authentication mapping overwritten.
498               ** Previous values were @authentication_mech='%1!',
499               ** @client_name='%2!' and @login_name='%3!'."
500               */
501               exec sp_getmessage 19940, @msg output
502               print @msg, @auth_mech, @client_name, @login_name
503           END
504           else if @action = 3
505           BEGIN
506               delete master.dbo.sysattributes
507               where class = @login_class and
508                   attribute = @attrib and
509                   object_cinfo = @externname and
510                   object_info1 = @authid
511               if (@@error != 0)
512                   goto clean_all
513   
514               /*
515               ** 19256 "Client authentication mapping updated."
516               */
517               exec sp_getmessage 19256, @msg output
518               print @msg
519           END
520   
521   
522   
523           /*
524           ** Sync the in-memory RDES with the new values
525           ** in sysattributes.
526           */
527           if attrib_notify(@login_class, @attrib, "LM", @suid, @authid, NULL,
528                   NULL, NULL, NULL, NULL, NULL, NULL, NULL,
529                   @action) = 0
530               goto clean_all
531   
532           /*
533           ** log the command for possible replication
534           */
535           if (@master_is_rep > 0)
536           begin
537               if (logexec(1) != 1)
538               begin
539                   /*
540                   ** , "17869 Stored procedure %1 failed'
541                   **       because '%2' failed in database '%3'."
542                   */
543                   raiserror 17869, "sp_maplogin", "logexec()", @dbname
544                   goto clean_all
545               end
546           end
547   
548           commit tran rs_logexec
549   
550           return (@retstat)
551       END
552   
553   clean_all:
554       rollback tran rs_logexec
555       return (1)
556   


exec sp_procxmode 'sp_maplogin', 'AnyMode'
go

Grant Execute on sp_maplogin to public
go
DEFECTS
 MINU 4 Unique Index with nullable columns master..sysattributes master..sysattributes
 MTYP 4 Assignment type mismatch @syslog_authmch: varchar(30) = varchar(255) 277
 QPUI 4 Join or Sarg with Un-Rooted Partial Index Use SARG Candidate index: spt_values.spt_valuesclust clustered
(number, type)
Intersection: {type}
196
 QPUI 4 Join or Sarg with Un-Rooted Partial Index Use SARG Candidate index: spt_values.spt_valuesclust clustered
(number, type)
Intersection: {type}
246
 QPUI 4 Join or Sarg with Un-Rooted Partial Index Use SARG Candidate index: spt_values.spt_valuesclust clustered
(number, type)
Intersection: {type}
279
 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_info1}
Uncovered: [object_type, object, object_info2, object_info3]
451
 QPUI 4 Join or Sarg with Un-Rooted Partial Index Use SARG Candidate index: spt_values.spt_valuesclust clustered
(number, type)
Intersection: {type}
452
 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_info1}
Uncovered: [object_type, object, object_info2, object_info3]
482
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 216
 TNOI 4 Table with no index master..syscurconfigs master..syscurconfigs
 TNOU 4 Table with no unique index master..spt_values master..spt_values
 MGTP 3 Grant to public master..spt_values  
 MGTP 3 Grant to public master..sysattributes  
 MGTP 3 Grant to public master..syscurconfigs  
 MGTP 3 Grant to public master..syslogins  
 MGTP 3 Grant to public sybsystemprocs..sp_maplogin  
 MNER 3 No Error Check should check return value of exec 222
 MNER 3 No Error Check should check return value of exec 426
 MNER 3 No Error Check should check @@error after update 456
 MNER 3 No Error Check should check @@error after update 486
 MNER 3 No Error Check should check return value of exec 501
 MNER 3 No Error Check should check return value of exec 517
 MUCO 3 Useless Code Useless Begin-End Pair 62
 MUCO 3 Useless Code Useless Brackets 101
 MUCO 3 Useless Code Useless Brackets 103
 MUCO 3 Useless Code Useless Brackets 104
 MUCO 3 Useless Code Useless Brackets 111
 MUCO 3 Useless Code Useless Brackets 112
 MUCO 3 Useless Code Useless Brackets 121
 MUCO 3 Useless Code Useless Brackets 122
 MUCO 3 Useless Code Useless Brackets 132
 MUCO 3 Useless Code Useless Brackets 138
 MUCO 3 Useless Code Useless Brackets 150
 MUCO 3 Useless Code Useless Brackets 170
 MUCO 3 Useless Code Useless Brackets 184
 MUCO 3 Useless Code Useless Brackets 205
 MUCO 3 Useless Code Useless Brackets 233
 MUCO 3 Useless Code Useless Brackets 259
 MUCO 3 Useless Code Useless Brackets 287
 MUCO 3 Useless Code Useless Brackets 291
 MUCO 3 Useless Code Useless Brackets 296
 MUCO 3 Useless Code Useless Brackets 311
 MUCO 3 Useless Code Useless Brackets 328
 MUCO 3 Useless Code Useless Brackets 364
 MUCO 3 Useless Code Useless Brackets 374
 MUCO 3 Useless Code Useless Brackets 381
 MUCO 3 Useless Code Useless Brackets 385
 MUCO 3 Useless Code Useless Brackets 394
 MUCO 3 Useless Code Useless Brackets 420
 MUCO 3 Useless Code Useless Brackets 431
 MUCO 3 Useless Code Useless Brackets 493
 MUCO 3 Useless Code Useless Brackets 511
 MUCO 3 Useless Code Useless Brackets 535
 MUCO 3 Useless Code Useless Brackets 537
 MUCO 3 Useless Code Useless Brackets 550
 MUCO 3 Useless Code Useless Brackets 555
 MUPK 3 Update column which is part of a PK or unique index object 457
 MUPK 3 Update column which is part of a PK or unique index object 487
 QAFM 3 Var Assignment from potentially many rows 194
 QAFM 3 Var Assignment from potentially many rows 244
 QAFM 3 Var Assignment from potentially many rows 277
 QAFM 3 Var Assignment from potentially many rows 437
 QAFM 3 Var Assignment from potentially many rows 468
 QIWC 3 Insert with not all columns specified missing 7 columns out of 15 414
 QNAJ 3 Not using ANSI Inner Join 449
 QNAJ 3 Not using ANSI Inner Join 480
 QNUA 3 Should use Alias: Column object_cinfo should use alias sysattributes 439
 QNUA 3 Should use Alias: Column object_cinfo should use alias sysattributes 441
 QNUA 3 Should use Alias: Column object should use alias sysattributes 444
 QNUA 3 Should use Alias: Column object should use alias sysattributes 447
 QNUA 3 Should use Alias: Table master..sysattributes 449
 QNUA 3 Should use Alias: Column attribute should use alias sysattributes 450
 QNUA 3 Should use Alias: Column class should use alias sysattributes 450
 QNUA 3 Should use Alias: Column object_info1 should use alias sysattributes 451
 QNUA 3 Should use Alias: Column object_cinfo should use alias sysattributes 454
 QNUA 3 Should use Alias: Column object_info1 should use alias sysattributes 454
 QNUA 3 Should use Alias: Column object_cinfo should use alias sysattributes 470
 QNUA 3 Should use Alias: Column object_cinfo should use alias sysattributes 472
 QNUA 3 Should use Alias: Column object should use alias sysattributes 475
 QNUA 3 Should use Alias: Column object should use alias sysattributes 478
 QNUA 3 Should use Alias: Table master..sysattributes 480
 QNUA 3 Should use Alias: Column attribute should use alias sysattributes 481
 QNUA 3 Should use Alias: Column class should use alias sysattributes 481
 QNUA 3 Should use Alias: Column object_info1 should use alias sysattributes 482
 QNUA 3 Should use Alias: Column object_cinfo should use alias sysattributes 484
 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_info1, object_cinfo, attribute, class}
366
 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: {class, attribute, object_cinfo}
371
 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_info1, object_cinfo, attribute, class}
458
 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: {class, attribute, object_cinfo}
488
 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_info1, object_cinfo, attribute, class}
507
 QSWV 3 Sarg with variable @syslog_authid, Candidate Index: spt_values.spt_valuesclust clustered(number, type) U 279
 VNRD 3 Variable is not read @dummy 108
 MSUB 2 Subquery Marker 213
 MSUB 2 Subquery Marker 302
 MSUB 2 Subquery Marker 365
 MSUB 2 Subquery Marker 370
 MTR1 2 Metrics: Comments Ratio Comments: 50% 57
 MTR2 2 Metrics: Cyclomatic Complexity Cyclo: 57 = 68dec - 13exi + 2 57
 MTR3 2 Metrics: Query Complexity Complexity: 211 57
 PRED_QUERY_COLLECTION 2 {a=master..sysattributes, sv=master..spt_values} 0 437
 PRED_QUERY_COLLECTION 2 {a=master..sysattributes, sv=master..spt_values} 0 468

DATA PROPAGATION detailed
ColumnWritten To
@externnamesysattributes.object_cinfo   sp_optgoal_rset_002.name sp_passwordpolicy_rset_001.value sp_rjs_retrieve_rset_001.js_server

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