November 5, 2012 at 8:17 am
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
November 5, 2012 at 9:23 am
What error you got??
November 5, 2012 at 11:55 am
you can search fro more infor by searching "SQL SERVER CHANGE DATABASE OWNER;
the BOL Links are here for the explanation and the code:
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
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply