Friday, February 17, 2012

Error 21776: [SQL-DMO] The name 'XXXX' was not found in the Users collection

Hello --
We have a SQL Server 2000 machine that has approximately 500 user databases.
Don't ask why -- I did not create this mess.
Anyway, we have about 200 users access the SQL Server as a DSS machine
using SA. We've finally weaned all users off of SA and each have their on
ID per customer.
Tonight, I was finally trying to change the "SA" password from within
Enterprise Manager and received the following message:
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.
It looks like I'm receiving this message for every database we have.
I brought up another instance of Enterprise Manager and looked at each
database property and noticed that the owner of database was either "SA",
"NT user that happens to be logged into server most of the time", or some
other local SQL Server user.
How do I fix this problem?
All databases should simply belong to DBO and no one inparticular.
The problem is, I have multiple people that create databases and they all
log into the server differenently and use different steps in creating the
database.
Can I simply ignore these error messages?
If I do need to change the owner of all 500 databases, is there an easier
way than manually running sp_changedbowner?
...david
http://www.micro-mess.com
http://www.va-mustang.com
If you wish to reply to me personally, please remove
the "underline" from scandal_123@.cox.net. The is done to avoid SPAM!All databases need to be owned by a valid login or you may get errors in
Enterprise Manager. You can use a script below to generate a script that
changes database ownership to the login of your choosing.
SELECT 'EXEC ' +
CATALOG_NAME +
'..sp_changedbowner ''sa'''
FROM INFORMATION_SCHEMA.SCHEMATA
WHERE CATALOG_NAME NOT IN
(
'master',
'model',
'msdb',
'tempdb',
'distribution'
)
Hope this helps.
Dan Guzman
SQL Server MVP
"DavidM" <scandal_123@.cox.net> wrote in message
news:uYTjmAcxDHA.2448@.TK2MSFTNGP12.phx.gbl...
quote:

> Hello --
> We have a SQL Server 2000 machine that has approximately 500 user

databases.
quote:

> Don't ask why -- I did not create this mess.
> Anyway, we have about 200 users access the SQL Server as a DSS machine
> using SA. We've finally weaned all users off of SA and each have their on
> ID per customer.
> Tonight, I was finally trying to change the "SA" password from within
> Enterprise Manager and received the following message:
> 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.
> It looks like I'm receiving this message for every database we have.
> I brought up another instance of Enterprise Manager and looked at each
> database property and noticed that the owner of database was either "SA",
> "NT user that happens to be logged into server most of the time", or some
> other local SQL Server user.
> How do I fix this problem?
> All databases should simply belong to DBO and no one inparticular.
> The problem is, I have multiple people that create databases and they all
> log into the server differenently and use different steps in creating the
> database.
> Can I simply ignore these error messages?
> If I do need to change the owner of all 500 databases, is there an easier
> way than manually running sp_changedbowner?
> --
> ...david
> http://www.micro-mess.com
> http://www.va-mustang.com
> If you wish to reply to me personally, please remove
> the "underline" from scandal_123@.cox.net. The is done to avoid SPAM!
>

No comments:

Post a Comment