|
Home > Archive > MS SQL Server > November 2006 > Orphan users harder to fix in SQL Server 2005?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Orphan users harder to fix in SQL Server 2005?
|
|
| craigkenisston@hotmail.com 2006-11-09, 7:13 pm |
| I restored a database from one server to another.
I got an orphan user. Usually, on SQL Server 2000, all I have to do is
to drop the user and recreate it, since all tables/storeds belong to
DBO. This user should be the DB owner.
Same here, all tables belong to DBO, but when I try to delete the user
I get the message:
Drop failed for User 'asdfasdf'. (Microsoft.SqlServer.Express.Smo)
The database principal owns a schema in the database, and cannot be
dropped. (Microsoft SQL Server, Error: 15138)
I see the users properties and it does not own anything, all is under
DBO as far as I can see.
Where should I look to see what does this user owns ?
| |
| Tibor Karaszi 2006-11-09, 7:14 pm |
| > Where should I look to see what does this user owns ?
The Schema folder.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www. solidqualitylearning
.com/
< craigkenisston@hotma
il.com> wrote in message
news:1163095243.657742.50520@i42g2000cwa.googlegroups.com...
>I restored a database from one server to another.
> I got an orphan user. Usually, on SQL Server 2000, all I have to do is
> to drop the user and recreate it, since all tables/storeds belong to
> DBO. This user should be the DB owner.
> Same here, all tables belong to DBO, but when I try to delete the user
> I get the message:
>
> Drop failed for User 'asdfasdf'. (Microsoft.SqlServer.Express.Smo)
> The database principal owns a schema in the database, and cannot be
> dropped. (Microsoft SQL Server, Error: 15138)
>
> I see the users properties and it does not own anything, all is under
> DBO as far as I can see.
> Where should I look to see what does this user owns ?
>
| |
| Remus Rusanu [MSFT] 2006-11-09, 7:14 pm |
| Rather than drop the users, why not use the dedicated stored procedure for
this: sp_change_users_logi
n?
See http://msdn2.microsoft.com/en-US/library/ms174378.aspx
--
This posting is provided "AS IS" with no warranties, and confers no rights.
HTH,
~ Remus Rusanu
SQL Service Broker
http://msdn2.microsoft.com/en-us/library/ms166043(en-US,SQL.90).aspx
< craigkenisston@hotma
il.com> wrote in message
news:1163095243.657742.50520@i42g2000cwa.googlegroups.com...
>I restored a database from one server to another.
> I got an orphan user. Usually, on SQL Server 2000, all I have to do is
> to drop the user and recreate it, since all tables/storeds belong to
> DBO. This user should be the DB owner.
> Same here, all tables belong to DBO, but when I try to delete the user
> I get the message:
>
> Drop failed for User 'asdfasdf'. (Microsoft.SqlServer.Express.Smo)
> The database principal owns a schema in the database, and cannot be
> dropped. (Microsoft SQL Server, Error: 15138)
>
> I see the users properties and it does not own anything, all is under
> DBO as far as I can see.
> Where should I look to see what does this user owns ?
>
|
|
|
|
|