DatabaseProcApplicationCreatedLinks
sybsystemprocssp_addexternlogin  14 déc. 14Defects Propagation Dependencies

1     
2     /* Sccsid = "%Z% generic/sproc/src/%M% %I% %G%" */
3     
4     /*
5     ** Omni only
6     **
7     ** Messages for "sp_addexternlogin"    18294
8     **
9     ** 17240, "'%1!' is not a valid name."
10    ** 17260, "Can't run '%1!' from within a transaction."
11    ** 17270, "There is not a server named '%1!'."
12    ** 17271, "'%1!' is the local server - remote login not applicable."
13    ** 17067 "Unable to encrypt password for '%1!'. See prior error message for reason."
14    ** 18294, "User '%1!' is not a local user -- request denied."
15    ** 18295, "Only the 'sa' may update another's external login."
16    ** 18296, "External login updated."
17    ** 18297, "User '%1!' will be known as '%2!' in remote server '%3!'."
18    ** 18342, "Invalid name '%1!'. This role or user does not exist in this SQL Server." 
19    ** 18773, "HA_LOG: HA consistency check failure in '%1!' on the companion server '%2!'"
20    ** 18778, "Unable to find login '%1!' with id '%2!' in syslogins."
21    ** 18780, "Synchronization will not occur because server '%1!' is the companion server."
22    ** 18782 "Unable to find a server with name '%1!' and id '%2!'."
23    ** 18886, "Users with role '%1!' will be known as '%2!' in remote server '%3!'."
24    ** 19403, "IBM MQ servers cannot have a registered login"
25    ** 19404, "IBM MQ servers cannot have a default login"
26    */
27    
28    /* 
29    ** IMPORTANT: Please read the following instructions before
30    **   making changes to this stored procedure.
31    **
32    **	To make this stored procedure compatible with High Availability (HA),
33    **	changes to certain system tables must be propagated 
34    **	to the companion server under some conditions.
35    **	The tables include (but are not limited to):
36    **		syslogins, sysservers, sysattributes, systimeranges,
37    **		sysresourcelimits, sysalternates, sysdatabases,
38    **		syslanguages, sysremotelogins, sysloginroles,
39    **		sysalternates (master DB only), systypes (master DB only),
40    **		sysusers (master DB only), sysprotects (master DB only)
41    **	please refer to the HA documentation for detail.
42    **
43    **	Here is what you need to do: 
44    **	For each insert/update/delete statement, add three sections to
45    **	-- start HA transaction prior to the statement
46    **	-- add the statement
47    **	-- add HA synchronization code to propagate the change to the companion
48    **
49    **	For example, if you are adding 
50    **		insert master.dbo.syslogins ......
51    **	the code should look like:
52    **	1. Before that SQL statement:
53    **		
54    **	2. Now, the SQL statement:
55    **		insert master.dbo.syslogins ......
56    **	3. Add a HA synchronization section right after the SQL statement:
57    **		
58    **
59    **	You may need to do similar change for each built-in function you
60    **	want to add.
61    **
62    **	Finally, add a separate part at a place where it can not
63    **	be reached by the normal execution path:
64    **	clean_all:
65    **		
66    **		return (1)
67    */
68    
69    create or replace procedure sp_addexternlogin
70        @server varchar(255), /* name of remote server */
71        @loginame varchar(255), /* user's local name */
72        @externname varchar(255), /* user's remote name */
73        @externpasswd varchar(2000) = null, /* user's remote password */
74        @rolename varchar(255) = null, /* name of roll to map */
75        @passwd_vers int = 0 /* for replication */
76    as
77        begin
78    
79            declare @msg varchar(1024),
80                @encrpasswd varchar(2000),
81                @nullarg char(1),
82                @srvid smallint,
83                @dbname sysname,
84                @suid int,
85                @srid int,
86                @action smallint,
87                @dso_class smallint,
88                @attrib smallint,
89                @dummy int,
90                @maxlen int,
91                @HA_CERTIFIED tinyint,
92                @retstat int,
93                @srvclass smallint,
94                @prokey int,
95                @svckey int,
96                @stakey int,
97                @cfgoption int,
98                @replicate int,
99                @master_is_rep int,
100               @log_for_rep int,
101               @license int,
102               @status1 int,
103               @status2 int,
104               @gp_enabled int
105   
106   
107   
108           select @HA_CERTIFIED = 0,
109               @retstat = 0,
110               @srid = - 1,
111               @prokey = 1,
112               @svckey = 53,
113               @stakey = 54,
114               @cfgoption = 442,
115               @encrpasswd = null,
116               @replicate = 0,
117               @master_is_rep = 0,
118               @log_for_rep = 0,
119               @status1 = 1,
120               @status2 = 1,
121               @gp_enabled = 0
122   
123           select @license = license_enabled("ASE_ENCRYPTION")
124   
125           /*
126           ** The variable @passwd_vers is only non-zero in the replicated site.
127           ** It's not a general purpose variable. It can be used only to
128           ** indicate that the procedure is being executed by the replication
129           ** server and some manipulation of the password is needed.
130           */
131           if (@passwd_vers = 0)
132           begin
133               /* This is the replicate (primary) site */
134               select @replicate = 1
135   
136               /* 
137               ** master is replicated if this is the primary site
138               ** and the database master is marked for replication.
139               ** We will consider master as not being replicated
140               ** if this procedure is being executed by the
141               ** replication server (@passwd_vers != 0).
142               */
143               select @master_is_rep = getdbrepstat(1)
144   
145               if (@master_is_rep < 0)
146               begin
147                   raiserror 18409, "getdbrepstat"
148                   return (1)
149               end
150   
151               /* 
152               ** We are not interested on the level of replication,
153               ** only if it's replicated or not.
154               */
155               if (@master_is_rep != 0)
156               begin
157                   select @master_is_rep = 1
158               end
159   
160               /*
161               ** If we are logging this system procedure for replication, 
162               ** we must be in the 'master' database to avoid creating a 
163               ** multi-database transaction which could make recovery of 
164               ** the 'master' database impossible.
165               */
166               if (@master_is_rep = 1) and (db_name() != "master")
167               begin
168                   /*
169                   ** 18388, "You must be in the master database in order 
170                   ** to run '%1!'."
171                   */
172                   raiserror 18388, "sp_addexternlogin"
173                   return (1)
174               end
175           end
176   
177           if (@externname is not null)
178           begin
179               select @maxlen = length from master.dbo.syscolumns
180               where id = object_id("master.dbo.syslogins")
181                   and name = "name"
182   
183               if (char_length(@externname) > @maxlen)
184               begin
185                   /*
186                   ** 17240, "'%1!' is not a valid name."
187                   */
188                   raiserror 17240, @externname
189                   return (1)
190               end
191           end
192   
193           /*
194           ** Check the password length if it is plaintext or
195           ** encrypted with Sybase proprietary key
196           */
197           if ((@passwd_vers <= @prokey) and (@externpasswd is not null))
198           begin
199               select @maxlen = length from master.dbo.syscolumns
200               where id = object_id("master.dbo.syslogins")
201                   and name = "password"
202   
203               if (char_length(@externpasswd) > @maxlen)
204               begin
205                   /*
206                   ** 17240, "'%1!' is not a valid name."
207                   */
208                   raiserror 17240, @externpasswd
209                   return (1)
210               end
211           end
212   
213   
214   
215           /* Check to see if we are using HA specific SP for a HA enabled server. */
216           exec @retstat = sp_ha_check_certified 'sp_addexternlogin', @HA_CERTIFIED
217           if (@retstat != 0)
218               return (1)
219   
220           /*
221           **  If we're in a transaction, disallow this since it might make recovery
222           **  impossible.
223           */
224           if (@@trancount > 0)
225           begin
226               /*
227               ** 17260 Can't run '%1!' from within a transaction.
228               */
229               raiserror 17260, "sp_addexternlogin"
230               return 1
231           end
232   
233           set chained off
234   
235           set transaction isolation level 1
236   
237           /*
238           ** Check that the server name is valid.
239           */
240           select @srvid = srvid, @srvclass = srvclass
241           from master.dbo.sysservers
242           where srvname = @server
243   
244           if (@@rowcount = 0)
245           begin
246               /*		
247               ** 17270  "There is not a server named %1!"  
248               */
249               raiserror 17270, @server
250               return (1)
251           end
252   
253           /*
254           ** If it's the local server don't bother.
255           */
256           if (@srvid = 0)
257           begin
258               /*		
259               ** 17271 "'%1!' is the local server - remote login not applicable."
260               */
261               raiserror 17271, @server
262               return (1)
263           end
264   
265           /*
266           ** If @rolename was specified, ignore @loginame.
267           */
268           if (@rolename is not null)
269           begin
270               select @loginame = null
271   
272               /*
273               ** Check that the @rolename is valid.
274               */
275               select @srid = srid from master.dbo.syssrvroles
276               where name = @rolename
277   
278               if (@@rowcount != 1)
279               begin
280                   /* 
281                   ** 18342, "Invalid name '%1!'. This role or user does 
282                   ** not exist in this SQL Server."  
283                   */
284                   raiserror 18342, @rolename
285                   return (1)
286               end
287           end
288   
289           if (@loginame is null)
290           begin
291               select @suid = - 1
292           end
293           else
294           begin
295               select @suid = suser_id(@loginame)
296   
297               /*
298               ** Check that the @loginame is valid.
299               */
300               if (@suid is null)
301               begin
302                   /*		
303                   ** 18294 "User '%1!' is not a local user -- request denied."
304                   */
305                   raiserror 18294, @loginame
306                   return (1)
307               end
308           end
309   
310           /*
311           ** If granular permissions is not enabled 
312           ** only a user with sa_role or sso_role can add extern logins for 
313           ** another user or for a role.
314           ** If granular permisssions is enabled then the user must have
315           ** 'manage any remote login' permission.
316           */
317           if (@suid != suser_id())
318           begin -- {
319               select @dbname = db_name()
320               execute @status1 = sp_aux_checkroleperm "sso_role",
321                   "manage any remote login", @nullarg, @gp_enabled output
322   
323               if (@status1 != 0)
324               begin -- {
325                   if (@gp_enabled = 0)
326                   begin
327                       execute @status2 = sp_aux_checkroleperm
328                           "sa_role",
329                           @nullarg,
330                           @nullarg, @gp_enabled output
331                       if (@status2 > 0)
332                       begin
333                           /* 
334                           ** proc_role() will raise permission 
335                           ** errors and send audit records to 
336                           ** the audit trail
337                           */
338                           select @dummy = proc_role("sa_role")
339                           select @dummy = proc_role("sso_role")
340                           return (1)
341                       end
342                   end
343                   else
344                   begin
345                       /* send audit record to the audit trail. */
346                       select @dummy =
347                           proc_auditperm("manage any remote login",
348                               @status1)
349                       return (1)
350                   end
351               end -- }
352               /*
353               ** Send apropriate audit records, already determined user has 
354               ** one of the roles or the permission.
355               */
356               if (@gp_enabled = 0)
357               begin
358                   if (@status1 = 0)
359                       select @dummy = proc_role("sso_role")
360                   if (@status2 = 0)
361                       select @dummy = proc_role("sa_role")
362               end
363               else
364               begin
365                   select @dummy = proc_auditperm("manage any remote login",
366                           @status1)
367               end
368           end -- }
369   
370           /*
371           ** We don't allow IBM_MQ servers to have extern logins.
372           */
373           if (@srvclass = 13)
374           begin
375               if @loginame is null
376               begin
377                   /*
378                   ** 19404, "IBM MQ servers cannot have a default login"
379                   */
380                   raiserror 19404
381               end
382               else
383               begin
384                   /*
385                   ** 19403, "IBM MQ servers cannot have a registered login"
386                   */
387                   raiserror 19403
388   
389               end
390               return (1)
391           end
392   
393           /*
394           ** If there is already a user for this server defined, we'll update
395           ** it, else we'll insert a new row.
396           */
397           if ((@srvclass != 12) and (@srvclass != 14) and (@srvclass != 15))
398               select @dso_class = 9
399           else
400               select @dso_class = 21
401   
402           select @attrib = 0
403   
404           if exists (select * from master.dbo.sysattributes where
405                       class = @dso_class and attribute = @attrib and
406                       object_info1 = @srvid and object = @suid and
407                       (object_info2 = @srid or object_info2 is null))
408               select @action = 2 /* attribute change */
409           else
410               select @action = 1 /* attribute add */
411   
412           /*
413           ** First validate the row. 
414           */
415           if (attrib_valid(@dso_class, @attrib, "EL", @suid, @srvid, @srid, null,
416                       @externname, null, null, null, @externpasswd, null, @action) = 0)
417           begin
418               return (1)
419           end
420   
421   
422   
423           /*
424           ** This transaction also writes a log record for replicating the
425           ** invocation of this procedure. If logexec() fails, the transaction
426           ** is aborted.
427           **
428           ** IMPORTANT: The name rs_logexec is significant and is used by
429           ** the Adaptive Server.
430           */
431           begin tran rs_logexec
432   
433   
434   
435           /* Try encrypting using service key if available.  */
436           if ((@license = 1)
437                   and object_id("master.dbo.syb_extpasswdkey") is not null)
438           begin
439               select @encrpasswd =
440                   internal_encrypt(@externpasswd, @svckey, @passwd_vers)
441   
442               if (@encrpasswd is null)
443               begin
444                   /*
445                   ** 17067 "Unable to encrypt password for '%1!'.
446                   ** See prior error message for reason."
447                   */
448                   raiserror 17067, @externname
449                   select @retstat = 1
450                   goto clean_all
451               end
452           end
453   
454           /*
455           ** If the password could not be encrypted using the service key,
456           ** in the primary site, use sybase proprietary algorithm, in the
457           ** replicated, if any, just copy the password as it has been 
458           ** received.
459           */
460           if (@encrpasswd is null and @externpasswd is not null)
461           begin
462               if (@replicate = 0)
463               begin
464                   select @encrpasswd = @externpasswd
465               end
466               else
467               begin
468                   select @encrpasswd = internal_encrypt(@externpasswd,
469                           @prokey, @passwd_vers)
470               end
471           end
472   
473           /*
474           ** The external login should not be replicated when the server is 
475           ** an HADR member.
476           */
477           if exists (select * from master.dbo.sysservers
478                   where (srvname = @server or srvname = @server + "DR")
479                       and srvclass = (select number from master.dbo.spt_values
480                           where type = 'X' and
481                               lower(name) = lower("HADR_MEMBER")))
482           begin
483               select @log_for_rep = 0
484           end
485           else
486           begin
487               select @log_for_rep = 1
488           end
489   
490           /* 
491           ** @externpasswd has to be encrypted with the static key if master 
492           ** is replicated so the the value is picked up by logexec().
493           */
494           if (@master_is_rep = 1) and (@log_for_rep = 1)
495           begin
496               select @externpasswd = internal_encrypt(@externpasswd,
497                       @stakey, @passwd_vers)
498   
499               /*
500               ** Even if the plaintext password was null, strong encryption
501               ** only returns NULL in case of an error.
502               */
503               if (@externpasswd is null)
504               begin
505                   /*
506                   ** 17067 "Unable to encrypt password for '%1!'.
507                   ** See prior error message for reason."
508                   */
509                   raiserror 17067, @externname
510                   select @retstat = 1
511                   goto clean_all
512               end
513           end
514   
515           /*
516           ** Now update/insert the row
517           */
518           if (@action = 2)
519           begin
520   
521               update master.dbo.sysattributes
522               set object_cinfo = @externname,
523                   image_value = @encrpasswd
524               where class = @dso_class and attribute = @attrib and
525                   object_info1 = @srvid and object = @suid and
526                   (object_info2 = @srid or object_info2 is null)
527   
528           end
529           else
530           begin
531               insert into master.dbo.sysattributes(class, attribute,
532                   object_type, object_info1, object, object_cinfo,
533                   image_value, object_info2, object_info3,
534                   object_cinfo2, object_datetime)
535               values (@dso_class, @attrib, "EL", @srvid, @suid, @externname,
536                   @encrpasswd, @srid, user_id(),
537                   suser_name(), getdate())
538           end
539   
540           if (@@error != 0)
541           begin
542               select @retstat = 1
543               goto clean_all
544           end
545   
546   
547   
548           select @passwd_vers = @stakey
549           if (@log_for_rep = 1)
550           begin --{
551               if (logexec(1) != 1)
552               begin
553                   /*
554                   ** 17756, "The execution of the stored procedure '%1!'
555                   **         in database '%2!' was aborted because there
556                   **         was an error in writing the replication log
557                   **         record."
558                   */
559                   select @dbname = db_name()
560                   raiserror 17756, "sp_addexternlogin", @dbname
561   
562                   select @retstat = 1
563                   goto clean_all
564               end
565           end --}
566   
567           commit tran rs_logexec
568   
569           if (@@error != 0)
570               goto raise_error
571   
572           /*
573           ** We are all set successfully. Inform the user if needed if this
574           ** is not the primary site.
575           */
576           if (@replicate = 0)
577           begin
578               if (@action = 2)
579               begin
580                   /*
581                   ** 18296 "External login updated."
582                   */
583                   exec sp_getmessage 18296, @msg output
584                   print @msg
585               end
586               else
587               begin
588                   if (@rolename is not null)
589                   begin
590                       /*
591                       ** 18886 "Users with role '%1!' will be
592                       ** known as '%2!' in remote server '%3!'."
593                       */
594                       exec sp_getmessage 18886, @msg output
595                       print @msg, @rolename, @externname, @server
596                   end
597                   else
598                   begin
599                       /*
600                       ** 18297 "User '%1!' will be known as '%2!' 
601                       ** in remote server '%3!'."
602                       */
603                       exec sp_getmessage 18297, @msg output
604                       print @msg, @loginame, @externname, @server
605                   end
606               end
607           end
608   
609           /*
610           ** Sync the in-memory structures with the new values
611           ** in sysattributes. The procedure will return 1,
612           ** but the catalog changes have succeeded.
613           */
614           if (attrib_notify(@dso_class, @attrib, "EL", @suid, @srvid, @srid,
615                       null, null, null, null, null, null, null,
616                       @action) = 0)
617           begin
618               select @retstat = 1
619           end
620   
621   
622   
623           return (@retstat)
624   
625   clean_all:
626           rollback tran rs_logexec
627   
628   raise_error:
629   
630   
631           return (1)
632       end
633   
634   


exec sp_procxmode 'sp_addexternlogin', 'AnyMode'
go

Grant Execute on sp_addexternlogin to public
go
DEFECTS
 MINU 4 Unique Index with nullable columns master..sysattributes master..sysattributes
 MTYP 4 Assignment type mismatch image_value: image = varchar(2000) 523
 MTYP 4 Assignment type mismatch image_value: image = varchar(2000) 536
 QPUI 4 Join or Sarg with Un-Rooted Partial Index Use SARG Candidate index: spt_values.spt_valuesclust clustered
(number, type)
Intersection: {type}
480
 QTYP 4 Comparison type mismatch Comparison type mismatch: int vs smallint 406
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 479
 QTYP 4 Comparison type mismatch smallint = int 479
 QTYP 4 Comparison type mismatch Comparison type mismatch: int vs smallint 525
 TNOU 4 Table with no unique index master..spt_values master..spt_values
 MAW1 3 Warning message on %name% master..syscolumns.id: Warning message on syscolumns 180
 MAW1 3 Warning message on %name% master..syscolumns.id: Warning message on syscolumns 200
 MGTP 3 Grant to public master..spt_values  
 MGTP 3 Grant to public master..sysattributes  
 MGTP 3 Grant to public master..syscolumns  
 MGTP 3 Grant to public master..sysservers  
 MGTP 3 Grant to public master..syssrvroles  
 MGTP 3 Grant to public sybsystemprocs..sp_addexternlogin  
 MNER 3 No Error Check should check @@error after update 521
 MNER 3 No Error Check should check @@error after insert 531
 MNER 3 No Error Check should check return value of exec 583
 MNER 3 No Error Check should check return value of exec 594
 MNER 3 No Error Check should check return value of exec 603
 MUCO 3 Useless Code Useless Begin-End Pair 77
 MUCO 3 Useless Code Useless Brackets 131
 MUCO 3 Useless Code Useless Brackets 145
 MUCO 3 Useless Code Useless Brackets 148
 MUCO 3 Useless Code Useless Brackets 155
 MUCO 3 Useless Code Useless Brackets 173
 MUCO 3 Useless Code Useless Brackets 177
 MUCO 3 Useless Code Useless Brackets 183
 MUCO 3 Useless Code Useless Brackets 189
 MUCO 3 Useless Code Useless Brackets 197
 MUCO 3 Useless Code Useless Brackets 203
 MUCO 3 Useless Code Useless Brackets 209
 MUCO 3 Useless Code Useless Brackets 217
 MUCO 3 Useless Code Useless Brackets 218
 MUCO 3 Useless Code Useless Brackets 224
 MUCO 3 Useless Code Useless Brackets 244
 MUCO 3 Useless Code Useless Brackets 250
 MUCO 3 Useless Code Useless Brackets 256
 MUCO 3 Useless Code Useless Brackets 262
 MUCO 3 Useless Code Useless Brackets 268
 MUCO 3 Useless Code Useless Brackets 278
 MUCO 3 Useless Code Useless Brackets 285
 MUCO 3 Useless Code Useless Brackets 289
 MUCO 3 Useless Code Useless Brackets 300
 MUCO 3 Useless Code Useless Brackets 306
 MUCO 3 Useless Code Useless Brackets 317
 MUCO 3 Useless Code Useless Brackets 323
 MUCO 3 Useless Code Useless Brackets 325
 MUCO 3 Useless Code Useless Brackets 331
 MUCO 3 Useless Code Useless Brackets 340
 MUCO 3 Useless Code Useless Brackets 349
 MUCO 3 Useless Code Useless Brackets 356
 MUCO 3 Useless Code Useless Brackets 358
 MUCO 3 Useless Code Useless Brackets 360
 MUCO 3 Useless Code Useless Brackets 373
 MUCO 3 Useless Code Useless Brackets 390
 MUCO 3 Useless Code Useless Brackets 397
 MUCO 3 Useless Code Useless Brackets 415
 MUCO 3 Useless Code Useless Brackets 418
 MUCO 3 Useless Code Useless Brackets 436
 MUCO 3 Useless Code Useless Brackets 442
 MUCO 3 Useless Code Useless Brackets 460
 MUCO 3 Useless Code Useless Brackets 462
 MUCO 3 Useless Code Useless Brackets 503
 MUCO 3 Useless Code Useless Brackets 518
 MUCO 3 Useless Code Useless Brackets 540
 MUCO 3 Useless Code Useless Brackets 549
 MUCO 3 Useless Code Useless Brackets 551
 MUCO 3 Useless Code Useless Brackets 569
 MUCO 3 Useless Code Useless Brackets 576
 MUCO 3 Useless Code Useless Brackets 578
 MUCO 3 Useless Code Useless Brackets 588
 MUCO 3 Useless Code Useless Brackets 614
 MUCO 3 Useless Code Useless Brackets 623
 MUCO 3 Useless Code Useless Brackets 631
 MUPK 3 Update column which is part of a PK or unique index object_cinfo 522
 QAFM 3 Var Assignment from potentially many rows 179
 QAFM 3 Var Assignment from potentially many rows 199
 QAFM 3 Var Assignment from potentially many rows 275
 QISO 3 Set isolation level 235
 QIWC 3 Insert with not all columns specified missing 4 columns out of 15 531
 QPRI 3 Join or Sarg with Rooted Partial Index Use SARG Candidate index: syscolumns.csyscolumns unique clustered
(id, number, colid)
Intersection: {id}
180
 QPRI 3 Join or Sarg with Rooted Partial Index Use SARG Candidate index: syscolumns.csyscolumns unique clustered
(id, number, colid)
Intersection: {id}
200
 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: {attribute, object_info2, object_info1, object, class}
405
 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: {attribute, object_info2, object_info1, object, class}
524
 VNRD 3 Variable is not read @cfgoption 114
 VNRD 3 Variable is not read @dummy 365
 VNRD 3 Variable is not read @passwd_vers 548
 MSUB 2 Subquery Marker 404
 MSUB 2 Subquery Marker 477
 MSUB 2 Subquery Marker 479
 MTR1 2 Metrics: Comments Ratio Comments: 48% 69
 MTR2 2 Metrics: Cyclomatic Complexity Cyclo: 50 = 62dec - 14exi + 2 69
 MTR3 2 Metrics: Query Complexity Complexity: 219 69

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
@externpasswdsysattributes.image_value  
@loginamesysattributes.object   °.object_info1   °.object_info3   °.char_value   sysremotelogins.remoteserverid   sysservers.srvid   sysattributes.object_info1   °.object_info3   °.int_value   °.char_value  
sp_dropdevice_rset_001.device sp_checknames_rset_006.remoteserverid sp_checknames_rset_007.srvid sp_checknames_rset_008.srvid sp_dbrecovery_order_rset_001.Database Name °.Database id sp_displayroles_rset_001.Role Name sp_displayroles_rset_002.Role Name °.Grantee sp_displayroles_rset_003.Role Name
sp_displayroles_rset_004.Role Name sp_dropdevice_rset_001.device sp_forceonline_object_rset_001.Object °.status sp_forceonline_object_rset_002.Object °.status sp_forceonline_page_rset_001.status sp_forceonline_page_rset_002.status sp_listsuspect_object_rset_001.Object °.Access
sp_listsuspect_page_rset_001.Object °.Access sp_makesuspect_obj_rset_001.Obj °.Indid °.LogType °.PageType °.ErrType °.Delay °.TotalNum sp_makesuspect_obj_rset_002.Obj
°.Indid °.LogType °.PageType °.ErrType °.Delay °.TotalNum sp_makesuspect_obj_rset_003.Obj °.Indid °.LogType °.PageType
°.ErrType °.Delay °.TotalNum sp_memlog_rset_001.dumps_per_file sp_passwordpolicy_rset_001.message sp_passwordpolicy_rset_002.value sp_passwordpolicy_rset_003.value sp_passwordpolicy_rset_004.Policy_option sp_rjs_retrieve_rset_001.host_name sp_setsuspect_granularity_rset_001.Online mode
sp_ssladmin_rset_001.certificate_path sp_ssladmin_rset_002.Cipher Suite Name °.Preference
@passwd_verssysattributes.image_value  

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