How to change dbo-login account is changed from DOM1\SQL_AC1 to DOM2\SQL_ACC1

  • Hi all,

    Presently my company is moving or realigning the Windows login & service accounts

    and we are changing the same for SQL server 2000 as well.

    I have successfully changed and started the SQL server Service usign the new Accout.

    I have also restored an old back up of a database in our Test Instance.

    But dbo-login account needs to is changed from DOM1\SQL_ACC1 to DOM2\SQL_ACC2, since DOM1\SQL_ACC1 no longer exits,but the when i see the user, dbo shows the login name as old, I need to change the same to new DOM2\SQL_ACC2.

    I have tried sp_changedbowner 'sa'

    SP_change_user_logins 'UPDATE_ONE', 'DOM1\SQL_ACC1 ', 'DOM2\SQL_ACC2'

    It gives me erro saying username is absent or invalid.

    Would highly appreciate all your suggestions..

    Thanks & Regards,

    Raja

  • Have you tried

    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.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply