Re: Changing DB Owner

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Dan Guzman (danguzman_at_nospam-earthlink.net)
Date: 08/17/04


Date: Tue, 17 Aug 2004 07:43:01 -0500

sp_changedbowner ought to work with both Windows and SQL logins. The
specified login must not already be a user in the database. Examples below.

    --standard login
    USE MyDatabase
    EXEC sp_changedbowner 'SQLAdmin'

    --Windows login
    USE MyDatabase
    EXEC sp_changedbowner 'Domain\SQLAdmin'

-- 
Hope this helps.
Dan Guzman
SQL Server MVP
"Mike B." <Autobahn97@hotmail.com> wrote in message
news:e$ytVNFhEHA.3428@TK2MSFTNGP11.phx.gbl...
> Inadvertantly I moved several DB's from one SQL box to another however
when
> I reattached the DB's onte Target server I was logged in as the incorrect
> user so the DB Owner shows up as my personal login and not the
> Domain\SQLAdmin user which we are supposed to perform maintanence under
> (oops).  I suspect things worked because my login ID is domain admin.  I
did
> find the command sp_changedbowner however I think it only works with SQL
> users and not Windows Domain users.  If this is correct could some one
> please send/post the exact syntax to change the DB owner from
Domain\mylogin
> to Domain\SQLAdmin?  Thanks!
>
>


Relevant Pages

  • Re: Permission question - another one
    ... If I add an Sql Login it does add the TRAVAC\ in front of the names, ... seems to be users that were setup to use SQL Server Authentication. ... RAPTOR is the Server that has SQL Server running on it. ... > " I could think I am taking permissions away from someone, ...
    (microsoft.public.sqlserver.programming)
  • Re: SQL 2k5 SP2 Mirroring - SQL in Mixed mode.
    ... US\sqlservices (old SQLservice account) still member of built-in local admin ... Login: US\sqlservices ... How can I transfer the SQL logins to ... Here is SP_help_revlogin results from the Principal Server (NYSQL-3) ...
    (microsoft.public.sqlserver.clustering)
  • Re: Renamed Windows login not found in SQL Server 2000
    ... It's almost like SQL tuck some knowledge away in an area ... of memory that only gets released on Windows stop. ... > I am running SQL Server 2000 SP2 with Windows ... > login gets corrupted) I am unable to add the new login to ...
    (microsoft.public.sqlserver.security)
  • Re: SQL Server on XP Home Network
    ... The sa account is the system administrator "God" account witihin SQL ... This account is a SQL-Server login. ... You might be able to use Enterprise Manager to go in and create a new SQL ... Select the "SQL Server Authentication" ...
    (microsoft.public.sqlserver.setup)
  • RE: Getting Challenged when using SQL connection on .aspx page
    ... What would happen if i removed integrated security=sspi from the connection ... Just want the login token to be passed, ... Have webpage with following connection in the ... I have account to the database on the SQL server. ...
    (microsoft.public.dotnet.framework.aspnet)