Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

database ownership issues Expand / Collapse
Author
Message
Posted Monday, November 5, 2012 8:17 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Tuesday, December 17, 2013 12:46 PM
Points: 38, Visits: 65
I have my databases user and default schema set for 'dbo'
but if i import a new database , and look at the security its user and default schema fields are empty and if i try to assign sa as db_owner of this database i get an error.
how can i make this database after import user=dbo and 'default schema'=dbo
and have sa user teh dbowner of this database .. .like my all other databases ?

thanks
Post #1381105
Posted Monday, November 5, 2012 9:23 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Monday, September 15, 2014 5:34 AM
Points: 2,609, Visits: 3,903
What error you got??
Post #1381155
Posted Monday, November 5, 2012 11:55 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 6:34 PM
Points: 12,895, Visits: 32,093
you can search fro more infor by searching "SQL SERVER CHANGE DATABASE OWNER;

the BOL Links are here for the explanation and the code:
Changing the Database Owner
ALTER AUTHORIZATION (Transact-SQL)

and a basic command example:
--SQL2005 and before:
--assumes the current database is the one to change
EXEC sp_changedbowner 'sa'
--2008 and after
ALTER AUTHORIZATION
ON database::SandBox
TO sa



Lowell

--There is no spoon, and there's no default ORDER BY in sql server either.
Actually, Common Sense is so rare, it should be considered a Superpower. --my son
Post #1381228
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse