SQL2000 sa password cannot be changed by resolution, the following error occurred in changing the sa password:
Copy Code code as follows:
Error 21776: [SQL-DMO] The name ' dbo ' is not found in the Users collection. If The name is a qualified name, use [] to separate various parts of the name, and try again.
WORKAROUND: Connect to SQL with the query manager with SQL and execute:
Copy Code code as follows:
EXEC sp_password NULL, ' XXXXXX ', ' sa '
Specific information about Sp_password is as follows:
Sp_password
Add or change Microsoft? SQL Server? The password for the login.
Grammar
sp_password [[@old =] ' Old_password ',]
{[@new =] ' New_password '}
[ , ] [@loginame =] ' Login ']
Parameters
[@old =] ' Old_password '
is the old password. Old_password is a sysname type with a default value of NULL.
[@new =] ' New_password '
is the new password. New_password is a sysname type with no default value. If you do not use named parameters, you must specify Old_password.
[@loginame =] ' Login '
is the login name that is affected by the password change. Login is a sysname type with a default value of NULL. Login must already exist and can only be specified by members of the sysadmin fixed server role.
Return code value
0 (Success) or 1 (failed)
Comments
The SQL Server password can contain 1 to 128 characters, which can include any letter, symbol, and number.
The new password is updated and stored in an encrypted form, so no user (even the system administrator) can view the password.
When members of the sysadmin or securityadmin fixed server role reset their own passwords with sp_password with all three parameters, the audit records reflect that they are changing someone else's password.
Sp_password not available for Microsoft Windows NT? Security account. Users connected to SQL Server through a Windows NT network account are authorized by Windows NT, so their passwords can only be changed in Windows NT.
Sp_password cannot be executed in a user-defined transaction.
Permissions
Execute permissions are granted to the public role by default to allow users to change their logon password. Only members of the sysadmin role can change the logon password of another user.
Example
A. Change the login password without the original password
The following example changes the password for the login Victoria to OK.
Copy Code code as follows:
EXEC sp_password NULL, ' OK ', ' Victoria '
B. Change Password
The following example changes the password for the login Victoria from OK to coffee.
Copy Code code as follows:
EXEC sp_password ' OK ', ' coffee '