use db_name_here
--find out the existing dbowner name here :
select name,suser_sname(owner_sid) from sys.databases--sql server 2005
select name,suser_sname(sid) from sys.databases--sql server 2000
sp_changedbowner @loginame='login_name_here'
Please note that the login name here should exists as a server principal and most importantly it should not have any user mapped in the current db context.It is only then that the command will execute successfully.
Now in order to check the new dbowner re-execute the below command :
select name,suser_sname(owner_sid) from sys.databases
select name,suser_sname(sid) from sys.databases--sql server 2000
Tuesday, August 17, 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment