Hi xchange,
use sp_changeDbOwner
Changes the owner of the current database.
Syntax
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 Microsoft® SQL Server™ login or a Microsoft Windows NT® user that already exists. 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.
[@map =] remap_alias_flag
Is the value true or false, which indicates whether existing aliases to the old database owner (dbo) are mapped to the new owner of the current database or dropped. remap_alias_flag is varchar(5), with a default of NULL, indicating any existing aliases to the old dbo are mapped to the new owner of the current database. false indicates that existing aliases to the old database owner are dropped.
Cheers!
Main Topics
Browse All Topics





by: amit_gPosted on 2006-02-28 at 17:20:35ID: 16071475
Take steps given in
/tip/micro soft/sql_o rphan_user .htm
http://www.fileformat.info