Cry
about...
SQL Server Troubleshooting
Error 21776: [SQL-DMO] The name 'XXXX'
was not found in the Users collection.
Symptom:
When attempting to add a user (or modify a users properties) the following error is produced:
Error 21776: [SQL-DMO] The name 'XXXX' was
not found in the Users collection. If the name is a
qualified name, use [] to separate various parts of
the name, and try again.
Where XXXX is the name of the account that
is being created or having its properties viewed.
An agent has the status Never started and
whilst it can be told to start it doesn't run and the
status never change from Never started. This
can affect Snapshot Agents, Log Reader Agents,
Distribution Agents, Merge Agents or Miscellaneous Agents.
Cause:
Not known, but may be in some way a consequence of
having copied the database from another server.
Possible Remedies:
use MASTER
go
exec sp_revokedbaccess 'ACCOUNT'
exec sp_revokelogin 'DOMAIN\ACCOUNT'
go
use DATABASE
go
exec sp_revokedbaccess 'ACCOUNT'
exec sp_revokelogin 'DOMAIN\ACCOUNT'
exec sp_grant login 'DOMAIN\ACCOUNT'
exec sp_defaultdb 'DOMAIN\ACCOUNT','DATABASE'
exec sp_grantdbaccess 'DOMAIN\ACCOUNT',
'ACCOUNT'
go
where ACCOUNT is the name of the user
account, DOMAIN is the name of the NT
domain in which the account is defined and and DATABASE
is the name of the database that the user is to have
access.
|