Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
neena
Starting Member
10 Posts |
Posted - 2002-02-26 : 14:08:37
|
| I'm creating a database on remote server by running command from sql client using NT Authentication. This NT login has System Administrator server role provileges in SQL Server. My question is :1. who will be the database owner - NT Login / sa2. who will be the object owner.when I do sp_helpDB, it shows NT Login as database owner. On running command sp_changedbowner 'sa' ,TRUE it gives me error message - "Msg 15111, Level 16, State 1, Server CITISERV5, Procedure sp_changedbowner, Line 39The proposed new database owner is already aliased in the database."I want to make sa as database owner and also object owner.Pls help.... |
|
|
izaltsman
A custom title
1139 Posts |
Posted - 2002-02-26 : 14:25:27
|
| 1. who will be the database owner - NT Login / saNT Login.2. who will be the object owner.Which object? If you create a new object using the same NT Login that created your database (or any other login which happens to be a member of db_owner role), the object will be owned by dbo. To change the database ownership simply run EXEC sp_changedbowner 'sa' |
 |
|
|
neena
Starting Member
10 Posts |
Posted - 2002-02-26 : 17:08:16
|
| For creation of DB following steps are run-1. create empty DB2. Restore backup (Backup is taken from other SQL machine/location)3. Insert some records in tables.This is run from batch file using NT authentication.After step 1, owner is NT login, I run changedbowner to change owner to 'sa'Run step2 -restore, now DB owner in sysdatabases table is NT login.If I try to run changedbowner to make sa as owner, it gives me error that login is already user in db.do i need to update any sys tables after restore ???what's the option to make sure database owner is 'sa' at the end. |
 |
|
|
|
|
|
|
|