Monday, March 19, 2012

Drop SA from database in 7.0!

Dear Experts,
I have created a database using the SA account and now sa is the dbo. From
the Security panel in the enterprise manager have created an account with a
password defaulting to the database. Now I wish to drop sa as dbo and when i
try to do that it companins that sa is owning objects in the database! Pleas
e
let me know if i can change ownership from sa to new user.
Thanks
Manish Sawjiani
--
Three Cheers to technet for the Help!Manish
Have a look at sp_changeobjectowner in the BOL
"Manish Sawjiani" <ManishSawjiani@.discussions.microsoft.com> wrote in
message news:EFE2DF18-B4D6-4C1F-BEC1-C54F8E0818AD@.microsoft.com...
> Dear Experts,
> I have created a database using the SA account and now sa is the dbo. From
> the Security panel in the enterprise manager have created an account with
a
> password defaulting to the database. Now I wish to drop sa as dbo and when
i
> try to do that it companins that sa is owning objects in the database!
Please
> let me know if i can change ownership from sa to new user.
> Thanks
> Manish Sawjiani
> --
> Three Cheers to technet for the Help!|||From Query Analyzer, you can change the database owner using
sp_changedbowner:
USE MyDatabase
EXEC sp_changedbowner 'MyLogin'
Note that the specified account must not be an existing database user. The
account will be mapped to the 'dbo' database user.
Hope this helps.
Dan Guzman
SQL Server MVP
"Manish Sawjiani" <ManishSawjiani@.discussions.microsoft.com> wrote in
message news:EFE2DF18-B4D6-4C1F-BEC1-C54F8E0818AD@.microsoft.com...
> Dear Experts,
> I have created a database using the SA account and now sa is the dbo. From
> the Security panel in the enterprise manager have created an account with
> a
> password defaulting to the database. Now I wish to drop sa as dbo and when
> i
> try to do that it companins that sa is owning objects in the database!
> Please
> let me know if i can change ownership from sa to new user.
> Thanks
> Manish Sawjiani
> --
> Three Cheers to technet for the Help!|||Guess at minimum the system object shave to be owned by dbo,
so you cant remove this special user.
http://www.microsoft.com/technet/pr...s/c05ppcsq.mspx
and
dbo Versus db_owner
http://www.sqlservercentral.com/col...br />
oles.asp
HTH, Jens Smeyer

No comments:

Post a Comment