Hi
We have a script that allows customers to change the users of the
database including the database owner. This script can be run at any
time. However, sometimes (and it really is only sometimes!) when the
following statement executes:
"exec sp_changedbowner @USER_OWNER"
the following error is reported:
"The proposed new database owner is already a user in the database."
I have checked the other postings and the Books Online but cannot find
a way to query the current name of the dbowner i.e. the value of
@USER_OWNER above. We have to be able to do this within the script so
that if the @USER_OWNER variable is already the dbowner we do not
bother to execute the statement as otherwise this could display the
error. Can anybody help?
Thanks in Advance
Paul