Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Database owner


Database owner

Author
Message
Shaira
Shaira
SSC Journeyman
SSC Journeyman (96 reputation)SSC Journeyman (96 reputation)SSC Journeyman (96 reputation)SSC Journeyman (96 reputation)SSC Journeyman (96 reputation)SSC Journeyman (96 reputation)SSC Journeyman (96 reputation)SSC Journeyman (96 reputation)

Group: General Forum Members
Points: 96 Visits: 276
I have lots of databases that were created by several people - so they ended up being 'owned' by each of the creators. I would like (if possible) to have them all "owned" by the local admin account - not an individual. What should I look out for before I change the owner of these databases? I don't want anything to stop working in the name of conformity. Thanks!!
WayneS
WayneS
SSCertifiable
SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)

Group: General Forum Members
Points: 7003 Visits: 10435
What you're really talking about is changing what schema the tables belong to.

What you have to watch out for is any query that uses > 1 part naming convention:
<server>.<database>.<schema>.<table>

So, if the table belongs to schema xyz, and you reassign it to the dbo schema, then any query that references xyz.table specifically will fail.

If, like many queries, there isn't a schema qualifier, then when that user tries to run the schema, sql will determine that the table doesn't exist in that schema, and will go up the schema-chain and will find it in the dbo schema.

i.e.:
select * from xyz.table will fail, while
select * from table will not fail

Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
If you can't explain to another person how the code that you're copying from the internet works, then DON'T USE IT on a production system! After all, you will be the one supporting it!
Links: For better assistance in answering your questions, How to ask a question, Performance Problems, Common date/time routines,
CROSS-TABS and PIVOT tables Part 1 & Part 2, Using APPLY Part 1 & Part 2, Splitting Delimited Strings

sol.nt
sol.nt
Valued Member
Valued Member (73 reputation)Valued Member (73 reputation)Valued Member (73 reputation)Valued Member (73 reputation)Valued Member (73 reputation)Valued Member (73 reputation)Valued Member (73 reputation)Valued Member (73 reputation)

Group: General Forum Members
Points: 73 Visits: 136
shairal_t (6/2/2010)
I have lots of databases that were created by several people - so they ended up being 'owned' by each of the creators. I would like (if possible) to have them all "owned" by the local admin account - not an individual. What should I look out for before I change the owner of these databases? I don't want anything to stop working in the name of conformity. Thanks!!


As you mentioned,
I assume that you want to change the "owner" of database, not the db_owner role, don't you?
As far as i know, sql server have two "owner", one is the "owner" which is created when you create database and can not change, another one is the "db_owner" role which is assigned to user of sql server.
So, if i'am right, i don't know how you can change the "owner" of database?

Regards,

Sol
VastSQL
VastSQL
Hall of Fame
Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)

Group: General Forum Members
Points: 3303 Visits: 5075
U CHANGE THE OWNER BY

use master
GO
EXEC [DB_NAME].dbo.sp_changedbowner @loginame = N'LOGIN_NEW', @map = false
GO
Shaira
Shaira
SSC Journeyman
SSC Journeyman (96 reputation)SSC Journeyman (96 reputation)SSC Journeyman (96 reputation)SSC Journeyman (96 reputation)SSC Journeyman (96 reputation)SSC Journeyman (96 reputation)SSC Journeyman (96 reputation)SSC Journeyman (96 reputation)

Group: General Forum Members
Points: 96 Visits: 276
Yes - I would like to change the owner by using sp_changedbowner not change the schema - sorry for the confusion. So my question would be, what problems would I run into if I make them all the same? If they were all created by admins, does it even matter if they're the same?
VastSQL
VastSQL
Hall of Fame
Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)

Group: General Forum Members
Points: 3303 Visits: 5075
:-)
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search