Determine Database Owner
-
Posted on November 16, 2009 by Derek Dieter
-
1
Determining the database owner is important if you want to take advantage of cross-database-ownership-chaining. If databases have different owners, then you have issues with accessing objects between databases.
To find the database owners:
[cc lang=”sql”]
SELECT SUSER_SNAME(owner_sid)
FROM sys.databases
[/cc]
To change the owner of a database:
[cc lang=”sql”]
USE database
EXEC sp_changedbowner ‘sa’
[/cc]
The standard owner for databases is usually sa.
- Comments (RSS)
- Trackback
- Permalink
trying to find the owner of the database, when i select the sys.databases table the owner id is encrypted. in these types of scenarios how i can view who owns that databases
Hi Mark,The reason it spdees up is due to the fact that there is a table for users menu that lists the actions when a user logs into a company and by dropping the stored procedures and re-creating using the SQL Maintenance options re-creates the data in the table. This process was given to me by Microsoft Dynamics Tech Support Engineer.