Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / General / Security / July 2008

Tip: Looking for answers? Try searching our database.

unable to change db owner

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
John A Grandy - 29 Jul 2008 01:20 GMT
On my box I have Sql Server 2005 installed in mixed-mode.

I created a db and by default ( I assume ) it's owner is set to my logged-on
(local) Windows user.

I backup the db and successfully restore it onto another box with another
instance of Sql Server 2005. ( 64bit but I don't think this matters ).

However, the database is inaccessible because my (local) Windows user
doesn't exist on that box.

So, I go back to my box and attempt to change ownership to a Sql Server user
and backup/restore again :

EXEC sp_changedbowner 'MyUser'

Msg 15110, Level 16, State 1, Line 1

The proposed new database owner is already a user or aliased in the
database.
John A Grandy - 29 Jul 2008 01:35 GMT
Ahh, I found the solution :

sp_changedbowner [ @loginame = ] 'login'
   [ , [ @map = ] remap_alias_flag ]

Arguments
[@loginame =] 'login'

Is the login ID of the new owner of the current database. login is sysname,
with no default. login must be an already existing Microsoft® SQL ServerT
login or Microsoft Windows NT® user. login cannot become the owner of the
current database if it already has access to the database through an
existing alias or user security account within the database. To avoid this,
drop the alias or user within the current database first.

> On my box I have Sql Server 2005 installed in mixed-mode.
>
[quoted text clipped - 16 lines]
> The proposed new database owner is already a user or aliased in the
> database.
Roy Harvey (SQL Server MVP) - 29 Jul 2008 01:36 GMT
>EXEC sp_changedbowner 'MyUser'

>Msg 15110, Level 16, State 1, Line 1
>
>The proposed new database owner is already a user or aliased in the
>database.

Apparently you tried to assign a new owner by choosing an account that
is already a user in the database, and that is not allowed.  If you
must use MyUser then remove them as a user first.  Or you might just
assign sa as the owner, which is probably the least likely to cause
problems.

Roy Harvey
Beacon Falls, CT
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.