1 2 3 /*
4 ** WARNING: This system procedure is an un-documented system procedure
5 ** reserved for the exclusive use of Replication Server. Do *NOT* use this
6 ** system procedure to change a password. Use the system procedure
7 ** 'sp_password()' instead.
8 **
9 ** This system procedure is a wrapper for the built-in 'set_enc_password()'
10 ** and must have the same call signature as the system procedure
11 ** 'sp_password()'.
12 */13 14 /*
15 ** Generated by spgenmsgs.pl on Thu Feb 2 00:39:19 2006
16 */17 /*
18 ** raiserror Messages for password_rep [Total 2]
19 **
20 ** 17260, "Can't run %1! from within a transaction."
21 ** 17756, "The execution of the stored procedure '%1!' in database '%2!' was aborted because there was an error in writing the replication log record."
22 */23 /*
24 ** sp_getmessage Messages for password_rep [Total 0]
25 */26 /*
27 ** End spgenmsgs.pl output.
28 */29 30 createproceduresp_password_rep31 @caller_password varchar(255)=NULL,/* the current password of caller */32 @new_password varbinary(256)=NULL,/* the new password of the target acct*/33 /* a length of 256 is required to test if
34 ** user entered a passwd > 255 chars.
35 */36 @loginame varchar(255)=NULL,/* user to change password on */37 @immediate int = 0 /* if not 0, change the password in
38 ** all running processes for loginame.
39 */40 as41 42 declare@retcode int
43 44 /*
45 ** Do not allow this system procedure to be run from within a transaction
46 ** to avoid creating a multi-database transaction where the 'master'
47 ** database is not the co-ordinating database.
48 */49 if @@trancount > 0
50 begin51 raiserror 17260, "sp_password_rep"
52 return(1)53 end54 set chained off55 settransactionisolationlevel 1
56 57 select@retcode= set_enc_password(@new_password,@loginame)58 if(@retcode= 0)59 return(1)60 61 /*
62 ** If the 'master' database is marked for replication, the T-SQL built-in
63 ** 'logexec()' will log for replication the execution instance of this
64 ** system procedure. Otherwise, the T-SQL built-in 'logexec()' is a no-op.
65 */66 if(logexec(1)!= 1)67 begin68 raiserror 17756, "sp_password_rep", "master"
69 return(1)70 end71 72 return(0)73
exec sp_procxmode 'sp_password_rep', 'AnyMode'
go
Grant Execute on sp_password_rep to public
go