[dba-SQLServer] Changing database ownership

Arthur Fuller fuller.artful at gmail.com
Mon Feb 4 09:19:00 CST 2008


I have had similar problems, JC, and I don't quite understand why and how to
fix it easily. I do however have a work-around that seems to work.
Inelegant, I know, but if it works, it works, until some bolt of insight
strikes me.

1. Create a new database. Check that it is sound by opening the database
diagrams node on said database. It will either tell you that the stuff is
not installed and ask if you want to install it (This is good), or it will
tell you that you aren't the owner.
2. Assuming you are the owner, then use the Import Wizard to grab all the
data, sprocs, views, etc. from the other database and import them into the
newly created one.

After that, you can safely delete the old database.

A.

P.S.
Supposedly there is a simple system stored procedure to let you change the
ownership but I've had problems with it. Thus I experimented and came up
with the recipe above.



On Mon, Feb 4, 2008 at 10:07 AM, jwcolby <jwcolby at colbyconsulting.com>
wrote:

> I have another piece of SQL Server that I do not understand.  I generally
> work from my laptop (M90). I open SQL Server and create a database out on
> one of my servers.  I had two servers at the time, but I am down to one
> now.
> At the time I was creating a lot of the databases on server AZUL.  Azul's
> motherboard died and I moved the databases off to server Stonehenge.  When
> I
> try to attach the databases I get an error something to the effect "cannot
> attach because the user M90.jwcolby is not available".  Obviously
> m90.jwcolby is my user on my laptop, but why doesn't it just ask me for my
> username / password or something?  And how do I change the ownership to
> Stonehenge.user or something like that?  Do I even want to do so?
>
> To make matters even stranger, the attach works!  So I am able to continue
> truckin on but it is just one of those "panic moments" when I think that I
> am going to be locked out of my database.
>
> Does anyone have an English language explanation of what is happening,
> why,
> and how to cause it to go away?
>
> John W. Colby
> Colby Consulting
> www.ColbyConsulting.com <http://www.colbyconsulting.com/>
>
> _______________________________________________
> dba-SQLServer mailing list
> dba-SQLServer at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
> http://www.databaseadvisors.com
>
>



More information about the dba-SQLServer mailing list