DatabaseProcApplicationCreatedLinks
sybsystemprocssp_modifylogin  14 déc. 14Defects Propagation Dependencies

1     
2     /* Sccsid = "%Z% generic/sproc/src/%M% %I% %G%" */
3     /*	5.0	1.0	10/22/91	sproc/src/modifylogin */
4     
5     /*
6     ** Generated by spgenmsgs.pl on Thu Feb  2 00:39:18 2006 
7     */
8     /*
9     ** raiserror Messages for modifylogin [Total 14]
10    **
11    ** 17260, "Can't run %1! from within a transaction."
12    ** 17756, "The execution of the stored procedure '%1!' in database '%2!' was aborted because there was an error in writing the replication log record."
13    ** 17880, "No such account -- nothing changed."
14    ** 17925, "You entered an invalid option name. No change was made."
15    ** 17927, "Error in changing the value of the specified column."
16    ** 17928, "Invalid role name specified -- nothing changed."
17    ** 17929, "The specified role is not granted to the account -- nothing changed."
18    ** 17930, "Specify a value for the option to be modified."
19    ** 17932, "You entered an invalid value. No change was made."
20    ** 17933, "Specify the name of the option to be modified."
21    ** 18388, "You must be in the master database in order to run '%1!'."
22    ** 18409, "The built-in function '%1!' failed. Please see the other messages printed along with this message."
23    ** 18898, "Login script '%1!' is not valid."
24    ** 19257, "The authentication mechanism '%1!' is not valid."
25    */
26    /*
27    ** sp_getmessage Messages for modifylogin [Total 5]
28    **
29    ** 17926, "Option changed."
30    ** 17934, "All overrides for the password security option have been removed."
31    ** 18773, "HA_LOG: HA consistency check failure in stored procedure '%1!' on the companion server '%2!'."
32    ** 18778, "Unable to find login '%1!' with id '%2!' in syslogins."
33    ** 19259, "Warning. Authentication mechanism '%1!' is not enabled."
34    ** 19448 "An existing login mapping for user '%1!' allows only '%2!' 
35    **		authentication mechanism to be used."
36    ** 19812 "There is no login-specific '%1!' attribute set for this user."
37    ** 19813 "The login-specific '%1!' attribute has been removed."
38    */
39    /*
40    ** End spgenmsgs.pl output.
41    */
42    
43    /* 
44    ** IMPORTANT: Please read the following instructions before
45    **   making changes to this stored procedure.
46    **
47    **	To make this stored procedure compatible with High Availability (HA),
48    **	changes to certain system tables must be propagated 
49    **	to the companion server under some conditions.
50    **	The tables include (but are not limited to):
51    **		syslogins, sysservers, sysattributes, systimeranges,
52    **		sysresourcelimits, sysalternates, sysdatabases,
53    **		syslanguages, sysremotelogins, sysloginroles,
54    **		sysalternates (master DB only), systypes (master DB only),
55    **		sysusers (master DB only), sysprotects (master DB only)
56    **	please refer to the HA documentation for detail.
57    **
58    **	Here is what you need to do: 
59    **	For each insert/update/delete statement, add three sections to
60    **	-- start HA transaction prior to the statement
61    **	-- add the statement
62    **	-- add HA synchronization code to propagate the change to the companion
63    **
64    **	For example, if you are adding 
65    **		insert master.dbo.syslogins ......
66    **	the code should look like:
67    **	1. Before that SQL statement:
68    **		
69    **	2. Now, the SQL statement:
70    **		insert master.dbo.syslogins ......
71    **	3. Add a HA synchronization section right after the SQL statement:
72    **		
73    **
74    **	You may need to do similar change for each built-in function you
75    **	want to add.
76    **
77    **	Finally, add a separate part at a place where it can not
78    **	be reached by the normal execution path:
79    **	clean_all:
80    **		
81    **		return (1)
82    */
83    
84    create or replace procedure sp_modifylogin
85        @loginame varchar(255), /* the login name of the account being modified */
86        @option varchar(30) = NULL, /* the option to be updated */
87        @value varchar(255) = NULL /* the new character value of the option */
88    as
89        declare @suid int /* suid of account to be modified   */
90        declare @msg varchar(1024) /* message text */
91        declare @retstat int /* return status from other procedures */
92        declare @enable_login_role int /* value of the status bit which is used
93        ** for enabling a role
94        */
95    
96        declare @action int /* Insert, update or delete 
97        ** Sysattributes entry 
98        */
99        declare @attrib int /* attribute id in Sysattributes */
100       declare @passeclass int /* Class id in Sysattributes */
101       declare @int_val int /* convert char input into integer */
102       declare @deleted int /* toggle to print the right return message */
103       declare @rowcount_saved int /* Store @@rowcount as "if-then" resets it to 0*/
104       declare @dummy int
105       declare @HA_CERTIFIED tinyint /* Is the SP HA certified ? */
106       declare @defdb varchar(255) /* User's default database */
107       declare @dbname varchar(30) /* Parsed login script dbname */
108       declare @own varchar(30) /* Parsed login script owner */
109       declare @objname varchar(30) /* Parsed login script name */
110       declare @status int /* Output of sp_namecrack */
111       declare @procid int /* Login script id */
112       declare @curdb varchar(30) /* User's current database */
113       declare @sa_role int /* has sa_role */
114       declare @sso_role int /* has sso_role */
115       declare @sa_audited int /* proc_role(sa_role) was called */
116       declare @sso_audited int /* proc_role(sso_role) was called */
117       declare @sqltext varchar(2055) /* a string buffer for concatenated sql */
118       declare @authid int /* authe mechanism id */
119       declare @allauth int /* all auth mechanisms mask */
120       declare @map_authid int /* auth mech id for login mapping */
121       declare @map_authnm varchar(30) /* auth mech name for login mapping */
122       declare @login_class int /* sysattributes class for login mapping */
123       declare @login_attrib int /* sysattributes attribute for login mapping */
124       declare @config int
125       declare @err1 int /* temp. variable to store @@error */
126   
127       declare @log_for_rep int
128       declare @db_rep_level_all int
129       declare @db_rep_level_none int
130       declare @db_rep_level_l1 int
131       declare @lt_rep_get_failed int
132       declare @def_role_changed int
133       declare @nullarg char(1)
134       declare @gp_enabled int
135       declare @status1 int
136       declare @status2 int
137       declare @manage_any_login int
138       declare @manage_any_login_audited int
139   
140       select @status1 = 1
141       select @status2 = 1
142       select @sa_role = 0
143       select @sso_role = 0
144       select @manage_any_login = 0
145       select @manage_any_login_audited = 0
146   
147   
148       /*
149       ** Initialize some constants
150       */
151       select @db_rep_level_all = - 1,
152           @db_rep_level_none = 0,
153           @db_rep_level_l1 = 1,
154           @db_rep_level_l1 = 1,
155           @lt_rep_get_failed = - 2,
156           @def_role_changed = 0
157   
158       if (@loginame is null and @option = 'login script')
159       begin
160           exec @retstat = sp_logintrigger @value
161           return @retstat
162       end
163   
164       select @HA_CERTIFIED = 0
165   
166   
167   
168       /* check to see if we are using HA specific SP for a HA enabled server */
169       exec @retstat = sp_ha_check_certified 'sp_modifylogin', @HA_CERTIFIED
170       if (@retstat != 0)
171           return (1)
172   
173       /* Initialize variables */
174       select @rowcount_saved = 0,
175           @enable_login_role = 1,
176           @sa_audited = 0,
177           @sso_audited = 0
178   
179       /*
180       **  If granular permissions is not enabled, 
181       **  check whether sa_role or sso_role are set.
182       **  If granular permissions is enabled then check if 
183       ** 'manage any login' permission is set.
184       */
185       select @nullarg = NULL
186       execute @status1 = sp_aux_checkroleperm "sa_role", "manage any login",
187           @nullarg, @gp_enabled output
188   
189       execute @status2 = sp_aux_checkroleperm "sso_role", @nullarg, @nullarg,
190           @gp_enabled output
191   
192       if (@gp_enabled = 0)
193       begin
194           if (@status1 = 0)
195           begin
196               select @sa_role = 1
197           end
198   
199           if (@status2 = 0)
200           begin
201               select @sso_role = 1
202           end
203       end
204       else
205       begin
206           if (@status1 = 0)
207           begin
208               select @manage_any_login = 1
209           end
210       end
211   
212       /*
213       ** Do not allow this system procedure to be run from within a transaction
214       ** to avoid creating a multi-database transaction where the 'master'
215       ** database is not the co-ordinating database.
216       */
217       if @@trancount > 0
218       begin
219           /* 17260, "Can't run %1! from within a transaction." */
220           raiserror 17260, "sp_modifylogin"
221           return (1)
222       end
223       else
224       begin
225           set chained off
226       end
227   
228       set transaction isolation level 1
229   
230       /*
231       ** Get the replication status of the 'master' database
232       */
233       select @log_for_rep = getdbrepstat(1)
234       if (@log_for_rep = @lt_rep_get_failed)
235       begin
236           /*
237           ** 18409, "The built-in function getdbrepstat() failed.
238           ** Please see the other messages printed along with this message."
239           */
240           raiserror 18409, "getdbrepstat"
241           return (1)
242       end
243   
244       /*
245       ** Convert the replication status to a boolean
246       */
247       if (@log_for_rep != @db_rep_level_none)
248           select @log_for_rep = 1
249       else
250           select @log_for_rep = 0
251   
252       /*
253       ** If we are logging this system procedure for replication, we must be in
254       ** the 'master' database to avoid creating a multi-database transaction
255       ** which could make recovery of the 'master' database impossible.
256       */
257       if (@log_for_rep = 1) and (db_name() != "master")
258       begin
259           /*
260           ** 18388, "You must be in the master database in order to run '%1!'."
261           */
262           raiserror 18388, "sp_modifylogin"
263           return (1)
264       end
265   
266       if (@option is NULL)
267       begin
268           /*
269           ** 17933, "Specify the name of the option to be modified."
270           */
271           raiserror 17933
272           return (1)
273       end
274   
275       /* Allow NULL for 'login script' option when @loginame != 'all overrides' */
276       if ((@value is NULL) and ((@option != "login script") or
277                   (@loginame = "all overrides")))
278       begin
279           /*
280           ** 17930, "Specify a value for the option to be modified."
281           */
282           raiserror 17930
283           return (1)
284       end
285   
286       /* User is trying to modify user's own login */
287       if (suser_id(@loginame) = suser_id())
288       begin
289           /*
290           ** Allow only logins with sa/sso role to modify the foll. options:
291           ** o "min passwd length"
292           ** o "passwd expiration"
293           ** o "max failed_logins" 
294           ** o "login script"
295           ** o "add default role"
296           ** o "drop default role"
297           ** o "authenticate with"
298           */
299   
300   
301           if (@option = "min passwd length" or
302                   @option = "passwd expiration" or
303                   @option = "max failed_logins" or
304                   @option = "login script" or
305                   @option = "add default role" or
306                   @option = "drop default role" or
307                   @option = "authenticate with")
308           begin
309   
310               /* check if user has sa or sso role, proc_role will also do auditing
311               ** if required. proc_role will also print error message if required.
312               */
313   
314               if (@gp_enabled = 0)
315               begin
316                   if (@sa_role = 0 and @sso_role = 0)
317                   begin
318                       select @dummy = proc_role("sa_role")
319                       raiserror 17888, "modifylogin"
320                       return (1)
321                   end
322                   else
323                   begin
324                       if (@sa_role > 0)
325                       begin
326                           select @sa_audited = 1
327                           select @dummy = proc_role("sa_role")
328                       end
329                       if (@sso_role > 0)
330                       begin
331                           select @sso_audited = 1
332                           select @dummy = proc_role("sso_role")
333                       end
334                   end
335               end
336               else
337               begin
338                   select @manage_any_login_audited = 1
339                   select @dummy = proc_auditperm("manage any login",
340                           @status1)
341                   if (@manage_any_login = 0)
342                       return (1)
343               end
344           end
345       end
346       /*
347       ** If user is trying to modify someone else's login then
348       ** check if user has sso role, when modifying non security-related 
349       ** stuff sa role is also allowed. Proc_role will perform auditing
350       ** and print error message if required.
351       */
352       if (suser_id(@loginame) != suser_id())
353       begin
354           if (@option = "add default role" or
355                   @option = "drop default role" or
356                   @option = "passwd expiration" or
357                   @option = "min passwd length" or
358                   @option = "max failed_logins" or
359                   @option = "login script" or
360                   @option = "authenticate with")
361           begin
362               if (@gp_enabled = 0)
363               begin
364                   /* With or without SSO role, must be audited */
365                   if (@sso_audited = 0)
366                       select @dummy = proc_role("sso_role")
367   
368                   /* Cannot proceed without SSO role */
369                   if (@sso_role = 0)
370                       return (1)
371               end
372               else
373               begin
374                   if (@manage_any_login_audited = 0)
375                       select @dummy =
376                           proc_auditperm("manage any login",
377                               @status1)
378                   if (@manage_any_login = 0)
379                       return (1)
380               end
381           end
382           else
383           begin
384               /* Only SA and SSO can proceed */
385               if (@gp_enabled = 0)
386               begin
387                   if (@sa_role = 0 and @sso_role = 0)
388                   begin
389                       /* to perform auditing if sa_role fails */
390                       select @dummy = proc_role("sa_role")
391                       raiserror 17888, "modifylogin"
392                       return (1)
393                   end
394               end
395               else
396               begin
397                   if (@manage_any_login = 0)
398                   begin
399                       /* to perform auditing */
400                       select @dummy =
401                           proc_auditperm("manage any login",
402                               @status1)
403                   end
404               end
405   
406               /* Audit whatever has not been done yet */
407               if (@sso_role > 0 and @sso_audited = 0)
408                   select @dummy = proc_role("sso_role")
409               if (@sa_role > 0 and @sa_audited = 0)
410                   select @dummy = proc_role("sa_role")
411               if (@manage_any_login > 0 and @manage_any_login_audited = 0)
412                   select @dummy = proc_auditperm("manage any login",
413                           @status1)
414           end
415       end
416   
417       if ((@option = "passwd expiration") or (@option = "min passwd length") or
418               (@option = "max failed_logins"))
419       begin
420           /* master.dbo.sysattributes class that stores login overrides. */
421           select @passeclass = 14
422   
423           /* With the exception of 'clear', these options expect only numbers */
424           select @value = lower(@value)
425           if @value != "clear"
426           begin
427               select @int_val = convert(int, @value)
428   
429               /*
430               ** int_val can't be less than -1 or greater than 32767
431               ** For "min passwd length", it can't be greater than 30
432               */
433               if ((@int_val < - 1) or ((@option = "min passwd length") and
434                           (@int_val > 30)) or (@int_val > 32767))
435               begin
436                   /*
437                   ** 17932, "You entered an invalid value. No 
438                   ** change was made."
439                   */
440                   raiserror 17932
441                   return (1)
442               end
443           end
444       end
445   
446   
447       /* Check if "all overrides". If so, check the new value input.
448       ** If it is -1, then all entries in Sysattributes corresponding 
449       ** to the attribute are deleted. Else, the entries in master.dbo.sysattributes 
450       ** are overwritten with the new value
451       */
452       if (@loginame = "all overrides")
453       begin
454   
455           if (@option = "passwd expiration")
456               select @attrib = 0
457           else
458           if (@option = "min passwd length")
459               select @attrib = 1
460           else
461           if (@option = "max failed_logins")
462               select @attrib = 2
463           else
464           begin
465               /*
466               ** 17925, You entered an invalid option name. No change was made."
467               */
468               raiserror 17925
469               return (1)
470           end
471   
472           if @int_val = - 1
473           /* Remove all the overrides for the option */
474           begin
475               delete from master.dbo.sysattributes
476               where class = @passeclass AND attribute = @attrib
477                   AND object_cinfo = "login"
478   
479   
480   
481               /*
482               ** 17934, "All overrides for the password security option 
483               ** have been removed."
484               */
485               exec sp_getmessage 17934, @msg output
486               print @msg
487               return (0)
488           end
489   
490           else
491           /* Modify the value of the overrides for the option */
492           begin
493               if ((@log_for_rep = 1) or (@HA_CERTIFIED = 1))
494                   begin tran rs_logexec
495   
496   
497               update master.dbo.sysattributes
498               set int_value = @int_val
499               where class = @passeclass AND attribute = @attrib
500                   AND object_cinfo = "login"
501   
502               select @err1 = @@error, @rowcount_saved = @@rowcount
503   
504   
505   
506               if (@log_for_rep = 1)
507               begin
508                   /*
509                   ** If the 'master' database is marked for
510                   ** replication, the T-SQL built-in 'logexec()' will
511                   ** log for replication the execution instance of
512                   ** this system procedure.  Otherwise, the T-SQL
513                   ** built-in 'logexec()' is a no-op.
514                   */
515                   if (logexec(1) != 1)
516                   begin
517                       /*
518                       ** 17756, "The execution of the stored procedure
519                       **  '%1!' in database '%2!' was aborted because 
520                       **  there was an error in writing the replication
521                       **  log record."
522                       */
523                       raiserror 17756, "sp_modifylogin", "master"
524                       goto clean_all
525                   end
526               end
527   
528               if ((@log_for_rep = 1) or (@HA_CERTIFIED = 1))
529                   commit tran rs_logexec
530           end
531       end
532   
533       else
534       /* This must be modification for a specific login. */
535       begin
536           select @suid = suid
537           from master.dbo.syslogins
538           where name = @loginame
539               and ((status & 512) != 512) /* not LOGIN PROFILE */
540   
541           /* Check if the loginame exists */
542           if (@suid is NULL)
543           begin
544               /*
545               ** 17880, "No such account -- nothing changed."
546               */
547               raiserror 17880
548               return (1)
549           end
550   
551   
552           /*
553           **  Update takes place here: option can only be fullname for C2
554           */
555           if @option = "fullname"
556           begin
557   
558               if ((@log_for_rep = 1) or (@HA_CERTIFIED = 1))
559                   begin tran rs_logexec
560   
561   
562   
563               update master.dbo.syslogins set fullname = @value where suid = @suid
564               select @rowcount_saved = @@rowcount
565           end
566           else if (@option = "login script" and @loginame != "all overrides")
567           begin
568   
569               if ((@log_for_rep = 1) or (@HA_CERTIFIED = 1))
570                   begin tran rs_logexec
571   
572   
573   
574               /*
575               ** If the 'login script' is provided, get the object id
576               ** from the default database verifying that it's really 
577               ** a stored procedure.
578               */
579               if (@value is not NULL)
580               begin
581                   set nocount on
582   
583                   select @defdb = dbname
584                   from master.dbo.syslogins
585                   where name = @loginame
586   
587                   exec @status = sp_namecrack @value, @db = @dbname output,
588                       @owner = @own output, @object = @objname output
589   
590                   /* If a db name is given, it has to be the user's default */
591                   if ((@status != 0) or
592                           ((@dbname is not null) and (@dbname != @defdb)))
593                   begin
594                       /*
595                       ** 18898, "Login script '%1!' is not valid."
596                       */
597                       raiserror 18898, @value
598                       goto clean_all
599                   end
600   
601                   /* Verify that the object exists and its a stored proc */
602                   if (@own is not null)
603                       exec ("declare @dummy int " +
604                       "select @dummy = 1 from " + @defdb +
605                       "..sysobjects where name='" + @objname + "'" +
606                       " and type = 'P'" +
607                       " and uid = user_id('" + @own + "')")
608                   else
609                       exec ("declare @dummy int " +
610                       "select @dummy = 1 from " + @defdb +
611                       "..sysobjects where name='" + @objname + "'" +
612                       " and type = 'P'")
613   
614                   if (@@rowcount = 0)
615                       select @procid = NULL
616                   else if (@own is not null)
617                       select @procid = object_id(@defdb + '.' + @own + '.' + @objname)
618                   else
619                       select @procid = object_id(@defdb + '..' + @objname)
620   
621                   if (@procid is NULL)
622                   begin
623                       /*
624                       ** 18898, "Login script '%1!' is not valid."
625                       */
626                       raiserror 18898, @value
627                       goto clean_all
628                   end
629               end
630               else
631               begin
632                   select @procid = NULL
633               end
634   
635               update master.dbo.syslogins set procid = @procid
636               where name = @loginame
637   
638               select @rowcount_saved = @@rowcount
639           end
640   
641           else if @option = "defdb"
642           begin
643               execute @retstat = sp_defaultdb @loginame, @value
644   
645               if (@retstat = 0)
646               begin
647                   if (@log_for_rep = 1)
648                   begin
649                       /*
650                       ** If the 'master' database is marked for
651                       ** replication, the T-SQL built-in 'logexec()' will
652                       ** log for replication the execution instance of
653                       ** this system procedure.  Otherwise, the T-SQL
654                       ** built-in 'logexec()' is a no-op.
655                       */
656                       if (logexec(1) != 1)
657                       begin
658                           /*
659                           ** 17756, "The execution of the stored procedure
660                           ** '%1!' in database '%2!' was aborted because
661                           ** there was an error in writing the replication
662                           ** log record."
663                           */
664                           raiserror 17756, "sp_modifylogin", "master"
665                           goto clean_all
666                       end
667                   end
668               end
669               return (@retstat)
670           end
671           else if @option = "deflanguage"
672           begin
673               execute @retstat = sp_defaultlanguage @loginame, @value
674   
675               if (@retstat = 0)
676               begin
677                   if (@log_for_rep = 1)
678                   begin
679                       /*
680                       ** If the 'master' database is marked for
681                       ** replication, the T-SQL built-in 'logexec()' will
682                       ** log for replication the execution instance of
683                       ** this system procedure.  Otherwise, the T-SQL
684                       ** built-in 'logexec()' is a no-op.
685                       */
686                       if (logexec(1) != 1)
687                       begin
688                           /*
689                           ** 17756, "The execution of the stored procedure
690                           ** '%1!' in database '%2!' was aborted because
691                           ** there was an error in writing the replication
692                           ** log record."
693                           */
694                           raiserror 17756, "sp_modifylogin", "master"
695                           goto clean_all
696                       end
697                   end
698               end
699               return (@retstat)
700           end
701           else if @option = "add default role" or @option = "drop default role"
702           begin
703               /* 
704               ** verify that the role exists
705               */
706               if (role_id(@value) is NULL)
707               begin
708                   /*
709                   ** Invalid role name specified -- nothing changed
710                   */
711                   raiserror 17928
712                   return (1)
713               end
714   
715               /*
716               ** verify that the role is granted to the loginame
717               */
718               if not exists (select 1 from master.dbo.sysloginroles
719                       where suid = @suid and srid = role_id(@value))
720               begin
721                   /*
722                   ** The specified role is not granted to the 
723                   ** account -- nothing changed
724                   */
725                   raiserror 17929
726                   return (1)
727               end
728   
729               /*
730               ** perform the job
731               */
732   
733               if ((@log_for_rep = 1) or (@HA_CERTIFIED = 1))
734                   begin tran rs_logexec
735   
736   
737   
738               if @option = "add default role"
739               begin
740                   update master.dbo.sysloginroles set
741                       status = status | @enable_login_role
742                   where suid = @suid and srid = role_id(@value)
743               end
744               else if @option = "drop default role"
745               begin
746                   update master.dbo.sysloginroles set
747                       status = status & ~ @enable_login_role
748                   where suid = @suid and srid = role_id(@value)
749               end
750   
751               select @rowcount_saved = @@rowcount,
752                   @def_role_changed = 1
753           end
754           else
755           if ((@option = "passwd expiration") or (@option = "min passwd length") or
756                   (@option = "max failed_logins"))
757           begin
758               if (@option = "passwd expiration")
759                   select @attrib = 0
760               else
761               if (@option = "min passwd length")
762                   select @attrib = 1
763               else
764               if (@option = "max failed_logins")
765                   select @attrib = 2
766   
767               if exists (select 1 from master.dbo.sysattributes where
768                           class = @passeclass AND attribute = @attrib AND
769                           object = @suid AND object_cinfo = "login")
770                   select @action = 2
771               else
772                   select @action = 1
773   
774               if @value = "clear"
775               begin
776                   if @action = 1
777                   begin
778                       /* There is no login-specific attr for this user */
779                       exec sp_getmessage 19812, @msg output
780                       print @msg, @option
781                       return (1)
782                   end
783                   else
784                   begin
785                       /* Remove the login-specific setting for this attr */
786                       select @action = 0
787                       if ((@log_for_rep = 1) or (@HA_CERTIFIED = 1))
788                           begin tran rs_logexec
789   
790   
791   
792                       delete from master.dbo.sysattributes
793                       where class = @passeclass
794                           AND attribute = @attrib
795                           AND object = @suid
796                           AND object_cinfo = "login"
797   
798                       select @rowcount_saved = @@rowcount
799                       select @deleted = 1
800                   end
801               end
802   
803               else if attrib_valid(@passeclass, @attrib, "PS", @suid, NULL, NULL,
804                       NULL, "login", @int_val, NULL, NULL, NULL,
805                       NULL, @action) = 0
806               begin
807                   /*
808                   ** 17932, "You entered an invalid value. No
809                   ** change was made."
810                   */
811                   raiserror 17932
812                   return (1)
813               end
814   
815               else
816               begin
817                   if ((@log_for_rep = 1) or (@HA_CERTIFIED = 1))
818                       begin tran rs_logexec
819   
820   
821   
822                   if @action = 1
823                   begin
824                       insert into master.dbo.sysattributes(class, attribute,
825                           object_type, object, object_cinfo, int_value)
826                       values
827                       (@passeclass, @attrib, "PS", @suid, "login", @int_val)
828                   end
829                   else
830                   begin
831                       update master.dbo.sysattributes
832                       set int_value = @int_val
833                       where class = @passeclass AND attribute = @attrib AND
834                           object = @suid AND object_cinfo = "login"
835                   end
836   
837                   select @rowcount_saved = @@rowcount
838               end
839           end
840           else if @option like "auth%with"
841           begin
842               /*
843               ** Check whether authentication mechanism specified is valid or not.
844               ** 'AUTH_DEFAULT' and 'AUTH_MASK' are new values added in spt_values
845               ** used to obtain value of default ('ANY') authmech or authentication
846               ** mask respectively. They are not valid names that the user can specify
847               ** as authentication mechanism.
848               */
849               select @authid = low, @config = number
850               from master.dbo.spt_values
851               where type = 'ua' and name = upper(@value)
852                   and upper(name) not in ('AUTH_DEFAULT', 'AUTH_MASK')
853   
854               if @@rowcount = 0
855               begin
856                   /*
857                   ** 19257, "The authentication mechanism '%1!' is not valid."
858                   */
859                   raiserror 19257, @value
860                   return (1)
861               end
862   
863               /*
864               ** Check if the authentication method is enabled.
865               ** SMP or SDC, one row is expected.
866               */
867               if (@config != 0) and not exists (select 1
868                       from master.dbo.syscurconfigs a
869   
870                       where a.config = @config and a.value != 0)
871   
872   
873               begin
874                   /*
875                   ** 19259, "Warning. Authentication mechanism '%1!' is not enabled."
876                   */
877                   exec sp_getmessage 19259, @msg output
878                   print @msg, @value
879               end
880   
881               /*
882               **  Obtain any login mapping for this login that may conflict
883               **  with the new authentication mechanism being set.  The following
884               **  query looks for the mapping in sysattributes by suid and
885               **  by comparing authid bitmask from object_info1 with the parameter
886               **  authid bitmask value. If a row is found, then prevent modifylogin
887               **  action from proceeding, thus avoiding the mapping conflict
888               **  with the new login restrictions.
889               */
890               select @login_class = 20, @login_attrib = 0
891   
892               select @map_authid = object_info1 from master.dbo.sysattributes where
893                   class = @login_class and attribute = @login_attrib and
894                   object = @suid and ((object_info1 & @authid) = 0)
895               if @@rowcount > 0
896               begin
897                   /* Lookup the name for the authid value found. */
898                   select @map_authnm = name
899                   from master.dbo.spt_values
900                   where type = 'ua' and low = @map_authid
901   
902                   /*		
903                   ** 19448 "An existing login mapping for user '%1!' 
904                   ** allows only '%2!' authentication mechanism to 
905                   ** be used."
906                   */
907                   raiserror 19448, @loginame, @map_authnm
908                   return (1)
909               end
910   
911               /* Reset any auth mechanisms bits and set this one. */
912               select @allauth = low
913               from master.dbo.spt_values
914               where type = 'ua' and upper(name) = 'AUTH_MASK'
915   
916               if ((@log_for_rep = 1) or (@HA_CERTIFIED = 1))
917                   begin tran rs_logexec
918   
919   
920   
921               /*
922               ** "ANY" is the name used for default authmech in sprocs, whereas the
923               **  value is obtained from AUTH_DEFAULT.
924               */
925               if (upper(@value) = 'ANY')
926               begin
927                   select @authid = low from master.dbo.spt_values
928                   where type = 'ua' and upper(name) = 'AUTH_DEFAULT'
929               end
930   
931               update master.dbo.syslogins
932               set status = @authid | (status & ~ @allauth)
933               where suid = @suid
934   
935               select @rowcount_saved = @@rowcount
936   
937   
938   
939               if (@log_for_rep = 1)
940               begin
941                   /*
942                   ** If the 'master' database is marked for replication, the
943                   ** T-SQL built-in 'logexec()' will log for replication the
944                   ** execution instance of this system procedure.  Otherwise,
945                   ** the T-SQL built-in 'logexec()' is a no-op.
946                   */
947                   if (logexec(1) != 1)
948                   begin
949                       /*
950                       ** 17756, "The execution of the stored procedure
951                       ** '%1!' in database '%2!' was aborted because
952                       ** there was an error in writing the replication
953                       ** log record."
954                       */
955                       raiserror 17756, "sp_modifylogin", "master"
956                       goto clean_all
957                   end
958               end
959   
960               if ((@log_for_rep = 1) or (@HA_CERTIFIED = 1))
961                   commit tran rs_logexec
962           end
963           else /* error */
964           begin
965               /*
966               ** 17925, "You entered an invalid option name. No change was made."
967               */
968               raiserror 17925
969               return (1)
970           end
971   
972       end
973   
974       /*
975       **  Check @rowcount_saved when it works
976       */
977       if (@rowcount_saved >= 1)
978       begin
979   
980   
981   
982           if (@log_for_rep = 1)
983           begin
984               /*
985               ** If the 'master' database is marked for replication, the
986               ** T-SQL built-in 'logexec()' will log for replication the
987               ** execution instance of this system procedure.  Otherwise,
988               ** the T-SQL built-in 'logexec()' is a no-op.
989               */
990               if (logexec(1) != 1)
991               begin
992                   /*
993                   ** 17756, "The execution of the stored procedure
994                   ** '%1!' in database '%2!' was aborted because
995                   ** there was an error in writing the replication
996                   ** log record."
997                   */
998                   raiserror 17756, "sp_modifylogin", "master"
999                   goto clean_all
1000              end
1001          end
1002  
1003          if ((@log_for_rep = 1) or (@HA_CERTIFIED = 1))
1004              commit tran rs_logexec
1005  
1006          /* Update protection timestamp in Resource */
1007          if (@def_role_changed = 1)
1008          begin
1009              grant all to null
1010          end
1011  
1012          if (@deleted = 1)
1013          begin
1014              exec sp_getmessage 19813, @msg output
1015              print @msg, @option
1016          end
1017          else
1018          begin
1019              /*
1020              ** 17926, "Option changed."
1021              */
1022              exec sp_getmessage 17926, @msg output
1023              print @msg
1024          end
1025          return (0)
1026      end
1027      else
1028      begin
1029          /*
1030          ** 17927, "Error in changing the value of the specified column."
1031          */
1032          raiserror 17927
1033          goto clean_all
1034      end
1035  
1036  clean_all:
1037      if ((@log_for_rep = 1) or (@HA_CERTIFIED = 1))
1038          rollback tran rs_logexec
1039      return (1)
1040  
1041  


exec sp_procxmode 'sp_modifylogin', 'AnyMode'
go

Grant Execute on sp_modifylogin to public
go
DEFECTS
 MRIT 5 Return in Transaction trancount is 2 669
 MRIT 5 Return in Transaction trancount is 2 699
 MRIT 5 Return in Transaction trancount is 2 712
 MRIT 5 Return in Transaction trancount is 2 726
 MRIT 5 Return in Transaction trancount is 3 781
 MRIT 5 Return in Transaction trancount is 4 812
 MRIT 5 Return in Transaction trancount is 5 860
 MRIT 5 Return in Transaction trancount is 5 908
 MRIT 5 Return in Transaction trancount is 5 969
 MRIT 5 Return in Transaction trancount is 4 1025
 MRIT 5 Return in Transaction trancount is 4 1039
 MCTR 4 Conditional Begin Tran or Commit Tran 494
 MCTR 4 Conditional Begin Tran or Commit Tran 529
 MCTR 4 Conditional Begin Tran or Commit Tran 559
 MCTR 4 Conditional Begin Tran or Commit Tran 570
 MCTR 4 Conditional Begin Tran or Commit Tran 734
 MCTR 4 Conditional Begin Tran or Commit Tran 788
 MCTR 4 Conditional Begin Tran or Commit Tran 818
 MCTR 4 Conditional Begin Tran or Commit Tran 917
 MCTR 4 Conditional Begin Tran or Commit Tran 961
 MCTR 4 Conditional Begin Tran or Commit Tran 1004
 MINU 4 Unique Index with nullable columns master..sysattributes master..sysattributes
 MTYP 4 Assignment type mismatch fullname: varchar(30) = varchar(255) 563
 MTYP 4 Assignment type mismatch @defdb: varchar(30) = varchar(255) 643
 MTYP 4 Assignment type mismatch @loginame: varchar(30) = varchar(255) 643
 MTYP 4 Assignment type mismatch @language: varchar(30) = varchar(255) 673
 MTYP 4 Assignment type mismatch @loginame: varchar(30) = varchar(255) 673
 MTYP 4 Assignment type mismatch attribute: smallint = int 827
 MTYP 4 Assignment type mismatch class: smallint = int 827
 MTYP 4 Assignment type mismatch @map_authnm: varchar(30) = varchar(255) 898
 QPUI 4 Join or Sarg with Un-Rooted Partial Index Use SARG Candidate index: spt_values.spt_valuesclust clustered
(number, type)
Intersection: {type}
851
 QPUI 4 Join or Sarg with Un-Rooted Partial Index Use SARG Candidate index: spt_values.spt_valuesclust clustered
(number, type)
Intersection: {type}
900
 QPUI 4 Join or Sarg with Un-Rooted Partial Index Use SARG Candidate index: spt_values.spt_valuesclust clustered
(number, type)
Intersection: {type}
914
 QPUI 4 Join or Sarg with Un-Rooted Partial Index Use SARG Candidate index: spt_values.spt_valuesclust clustered
(number, type)
Intersection: {type}
928
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 476
 QTYP 4 Comparison type mismatch smallint = int 476
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 499
 QTYP 4 Comparison type mismatch smallint = int 499
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 768
 QTYP 4 Comparison type mismatch smallint = int 768
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 793
 QTYP 4 Comparison type mismatch smallint = int 793
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 794
 QTYP 4 Comparison type mismatch smallint = int 794
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 833
 QTYP 4 Comparison type mismatch smallint = int 833
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 870
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 893
 QTYP 4 Comparison type mismatch smallint = int 893
 TNOI 4 Table with no index master..syscurconfigs master..syscurconfigs
 TNOU 4 Table with no unique index master..spt_values master..spt_values
 TNOU 4 Table with no unique index master..sysloginroles master..sysloginroles
 MDYN 3 Proc uses Dynamic SQL but is not flagged with Dynamic Ownership Chain 84
 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..sysloginroles  
 MGTP 3 Grant to public master..syslogins  
 MGTP 3 Grant to public sybsystemprocs..sp_modifylogin  
 MNER 3 No Error Check should check return value of exec 160
 MNER 3 No Error Check should check return value of exec 186
 MNER 3 No Error Check should check @@error after delete 475
 MNER 3 No Error Check should check return value of exec 485
 MNER 3 No Error Check should check @@error after update 563
 MNER 3 No Error Check should check @@error after update 635
 MNER 3 No Error Check should check @@error after update 740
 MNER 3 No Error Check should check @@error after update 746
 MNER 3 No Error Check should check return value of exec 779
 MNER 3 No Error Check should check @@error after delete 792
 MNER 3 No Error Check should check @@error after insert 824
 MNER 3 No Error Check should check @@error after update 831
 MNER 3 No Error Check should check return value of exec 877
 MNER 3 No Error Check should check @@error after update 931
 MNER 3 No Error Check should check return value of exec 1014
 MNER 3 No Error Check should check return value of exec 1022
 MUBC 3 Unbalanced begin tran/commit tran 1004
 MUCO 3 Useless Code Useless Brackets 158
 MUCO 3 Useless Code Useless Brackets 170
 MUCO 3 Useless Code Useless Brackets 171
 MUCO 3 Useless Code Useless Brackets 192
 MUCO 3 Useless Code Useless Brackets 194
 MUCO 3 Useless Code Useless Brackets 199
 MUCO 3 Useless Code Useless Brackets 206
 MUCO 3 Useless Code Useless Brackets 221
 MUCO 3 Useless Code Useless Brackets 234
 MUCO 3 Useless Code Useless Brackets 241
 MUCO 3 Useless Code Useless Brackets 247
 MUCO 3 Useless Code Useless Brackets 263
 MUCO 3 Useless Code Useless Brackets 266
 MUCO 3 Useless Code Useless Brackets 272
 MUCO 3 Useless Code Useless Brackets 276
 MUCO 3 Useless Code Useless Brackets 283
 MUCO 3 Useless Code Useless Brackets 287
 MUCO 3 Useless Code Useless Brackets 301
 MUCO 3 Useless Code Useless Brackets 314
 MUCO 3 Useless Code Useless Brackets 316
 MUCO 3 Useless Code Useless Brackets 320
 MUCO 3 Useless Code Useless Brackets 324
 MUCO 3 Useless Code Useless Brackets 329
 MUCO 3 Useless Code Useless Brackets 341
 MUCO 3 Useless Code Useless Brackets 342
 MUCO 3 Useless Code Useless Brackets 352
 MUCO 3 Useless Code Useless Brackets 354
 MUCO 3 Useless Code Useless Brackets 362
 MUCO 3 Useless Code Useless Brackets 365
 MUCO 3 Useless Code Useless Brackets 369
 MUCO 3 Useless Code Useless Brackets 370
 MUCO 3 Useless Code Useless Brackets 374
 MUCO 3 Useless Code Useless Brackets 378
 MUCO 3 Useless Code Useless Brackets 379
 MUCO 3 Useless Code Useless Brackets 385
 MUCO 3 Useless Code Useless Brackets 387
 MUCO 3 Useless Code Useless Brackets 392
 MUCO 3 Useless Code Useless Brackets 397
 MUCO 3 Useless Code Useless Brackets 407
 MUCO 3 Useless Code Useless Brackets 409
 MUCO 3 Useless Code Useless Brackets 411
 MUCO 3 Useless Code Useless Brackets 417
 MUCO 3 Useless Code Useless Brackets 433
 MUCO 3 Useless Code Useless Brackets 441
 MUCO 3 Useless Code Useless Brackets 452
 MUCO 3 Useless Code Useless Brackets 455
 MUCO 3 Useless Code Useless Brackets 458
 MUCO 3 Useless Code Useless Brackets 461
 MUCO 3 Useless Code Useless Brackets 469
 MUCO 3 Useless Code Useless Brackets 487
 MUCO 3 Useless Code Useless Brackets 493
 MUCO 3 Useless Code Useless Brackets 506
 MUCO 3 Useless Code Useless Brackets 515
 MUCO 3 Useless Code Useless Brackets 528
 MUCO 3 Useless Code Useless Brackets 542
 MUCO 3 Useless Code Useless Brackets 548
 MUCO 3 Useless Code Useless Brackets 558
 MUCO 3 Useless Code Useless Brackets 566
 MUCO 3 Useless Code Useless Brackets 569
 MUCO 3 Useless Code Useless Brackets 579
 MUCO 3 Useless Code Useless Brackets 591
 MUCO 3 Useless Code Useless Brackets 602
 MUCO 3 Useless Code Useless Brackets 614
 MUCO 3 Useless Code Useless Brackets 616
 MUCO 3 Useless Code Useless Brackets 621
 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 669
 MUCO 3 Useless Code Useless Brackets 675
 MUCO 3 Useless Code Useless Brackets 677
 MUCO 3 Useless Code Useless Brackets 686
 MUCO 3 Useless Code Useless Brackets 699
 MUCO 3 Useless Code Useless Brackets 706
 MUCO 3 Useless Code Useless Brackets 712
 MUCO 3 Useless Code Useless Brackets 726
 MUCO 3 Useless Code Useless Brackets 733
 MUCO 3 Useless Code Useless Brackets 755
 MUCO 3 Useless Code Useless Brackets 758
 MUCO 3 Useless Code Useless Brackets 761
 MUCO 3 Useless Code Useless Brackets 764
 MUCO 3 Useless Code Useless Brackets 781
 MUCO 3 Useless Code Useless Brackets 787
 MUCO 3 Useless Code Useless Brackets 812
 MUCO 3 Useless Code Useless Brackets 817
 MUCO 3 Useless Code Useless Brackets 860
 MUCO 3 Useless Code Useless Brackets 908
 MUCO 3 Useless Code Useless Brackets 916
 MUCO 3 Useless Code Useless Brackets 925
 MUCO 3 Useless Code Useless Brackets 939
 MUCO 3 Useless Code Useless Brackets 947
 MUCO 3 Useless Code Useless Brackets 960
 MUCO 3 Useless Code Useless Brackets 969
 MUCO 3 Useless Code Useless Brackets 977
 MUCO 3 Useless Code Useless Brackets 982
 MUCO 3 Useless Code Useless Brackets 990
 MUCO 3 Useless Code Useless Brackets 1003
 MUCO 3 Useless Code Useless Brackets 1007
 MUCO 3 Useless Code Useless Brackets 1012
 MUCO 3 Useless Code Useless Brackets 1025
 MUCO 3 Useless Code Useless Brackets 1037
 MUCO 3 Useless Code Useless Brackets 1039
 QAFM 3 Var Assignment from potentially many rows 849
 QAFM 3 Var Assignment from potentially many rows 892
 QAFM 3 Var Assignment from potentially many rows 898
 QAFM 3 Var Assignment from potentially many rows 912
 QAFM 3 Var Assignment from potentially many rows 927
 QISO 3 Set isolation level 228
 QIWC 3 Insert with not all columns specified missing 9 columns out of 15 824
 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}
476
 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}
499
 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, object_cinfo, attribute, class}
768
 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, object_cinfo, attribute, class}
793
 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, object_cinfo, attribute, class}
833
 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, attribute, class}
893
 QSWV 3 Sarg with variable @suid, Candidate Index: sysloginroles.csysloginroles clustered(suid) S 719
 QSWV 3 Sarg with variable @suid, Candidate Index: sysloginroles.csysloginroles clustered(suid) S 742
 QSWV 3 Sarg with variable @suid, Candidate Index: sysloginroles.csysloginroles clustered(suid) S 748
 QSWV 3 Sarg with variable @map_authid, Candidate Index: spt_values.spt_valuesclust clustered(number, type) U 900
 VNRD 3 Variable is not read @db_rep_level_all 151
 VNRD 3 Variable is not read @db_rep_level_l1 154
 VNRD 3 Variable is not read @dummy 412
 VNRD 3 Variable is not read @err1 502
 VUNU 3 Variable is not used @curdb 112
 VUNU 3 Variable is not used @sqltext 117
 MDYS 2 Dynamic SQL Marker 603
 MDYS 2 Dynamic SQL Marker 609
 MSUB 2 Subquery Marker 718
 MSUB 2 Subquery Marker 767
 MSUB 2 Subquery Marker 867
 MTR1 2 Metrics: Comments Ratio Comments: 45% 84
 MTR2 2 Metrics: Cyclomatic Complexity Cyclo: 131 = 155dec - 26exi + 2 84
 MTR3 2 Metrics: Query Complexity Complexity: 512 84

DATA PROPAGATION detailed
ColumnWritten To
@valuesysattributes.object   °.object_info1   °.object_info3   °.int_value   °.char_value   syslogins.dbname   °.language   °.fullname   °.procid   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_checknames_rset_010.name
sp_dbrecovery_order_rset_001.Database Name °.Database id °.Recovery Order sp_dbrecovery_order_rset_002.Recovery Order 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.Objid °.Object °.status sp_forceonline_object_rset_002.Objid °.Object °.status sp_forceonline_page_rset_001.Pageid °.status sp_forceonline_page_rset_002.Pageid °.status
sp_listsuspect_object_rset_001.Objid °.Object °.Access sp_listsuspect_page_rset_001.Pageid °.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 °.host_port sp_setsuspect_error_rset_001.Error Num sp_setsuspect_error_rset_002.Error Num sp_setsuspect_granularity_rset_001.Online mode sp_setsuspect_threshold_rset_001.Cur. Suspect threshold sp_setsuspect_threshold_rset_002.Cur. Suspect Threshold sp_ssladmin_rset_001.certificate_path
sp_ssladmin_rset_002.Cipher Suite Name °.Preference

DEPENDENCIES
PROCS AND TABLES USED
reads table master..syscurconfigs (1)  
read_writes table master..sysloginroles (1)  
reads table master..spt_values (1)  
calls proc sybsystemprocs..sp_getmessage  
   reads table sybsystemprocs..sysusermessages  
   calls proc sybsystemprocs..sp_validlang  
      reads table master..syslanguages (1)  
   reads table master..sysmessages (1)  
   reads table master..syslanguages (1)  
calls proc sybsystemprocs..sp_defaultlanguage  
   calls proc sybsystemprocs..sp_ha_check_certified  
      reads table tempdb..sysobjects (1)  
   calls proc sybsystemprocs..sp_aux_checkroleperm  
      reads table master..sysconfigures (1)  
      reads table master..syscurconfigs (1)  
   read_writes table master..syslogins (1)  
   calls proc sybsystemprocs..sp_getmessage  
   calls proc sybsystemprocs..sp_validlang  
calls proc sybsystemprocs..sp_namecrack  
calls proc sybsystemprocs..sp_logintrigger  
   read_writes table master..sysattributes (1)  
   calls proc sybsystemprocs..sp_aux_checkroleperm  
   calls proc sybsystemprocs..sp_ha_check_certified  
   writes table tempdb..#tmp (1) 
   calls proc sybsystemprocs..sp_getmessage  
   calls proc sybsystemprocs..sp_autoformat  
      calls proc sybsystemprocs..sp_namecrack  
      writes table sybsystemprocs..sp_autoformat_rset_002 
      calls proc sybsystemprocs..sp_autoformat  
      writes table sybsystemprocs..sp_autoformat_rset_001 
      reads table tempdb..systypes (1)  
      writes table sybsystemprocs..sp_autoformat_rset_005 
      read_writes table tempdb..#colinfo_af (1) 
      writes table sybsystemprocs..sp_autoformat_rset_003 
      reads table master..systypes (1)  
      writes table sybsystemprocs..sp_autoformat_rset_004 
      reads table tempdb..syscolumns (1)  
      reads table master..syscolumns (1)  
read_writes table master..syslogins (1)  
calls proc sybsystemprocs..sp_aux_checkroleperm  
calls proc sybsystemprocs..sp_ha_check_certified  
calls proc sybsystemprocs..sp_defaultdb  
   calls proc sybsystemprocs..sp_ha_check_certified  
   calls proc sybsystemprocs..sp_getmessage  
   calls proc sybsystemprocs..sp_aux_checkroleperm  
   read_writes table master..syslogins (1)  
   reads table master..sysdatabases (1)  
read_writes table master..sysattributes (1)