Here is a bit of sql to change all objects --> DBO.
http://bloggingabout.net/blogs/mischa/archive/2004/06/25/1059.aspx




----- Original Message ----- 
From: "Ryan Olshan" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Thursday, September 22, 2005 4:34 AM
Subject: Re: [AspNetAnyQuestionIsOk] SQL


>I had to restore a database and there is an orphan user which owns all
> objects. In order to recreate that user, I have to remove it as the owner 
> of
> all objects.
> Ryan
>
> On 9/21/05, Ying Jin <[EMAIL PROTECTED]> wrote:
>>
>>
>> There is a sysobjects table in the database. It has a
>> column uid of type smallint, it represents User ID of
>> owner object. To find out uid of a user, say Guest in
>> the database, you can search Sysusers table using
>> query like: select uid from sysusers where
>> name='guest'.
>> And then you can do a update on sysobjects with query:
>> Update sysobjects set uid=2
>>
>> But beware, doing this may break security measures
>> provided by SQL Server. May I ask why you want to do
>> this?
>>
>> Ying
>>
>> --- Ryan Olshan <[EMAIL PROTECTED]> wrote:
>>
>> > Does anybody know how to change the owner of ALL
>> > objects in a database?
>> >
>> > --
>> > Thank you,
>> > Ryan Olshan
>> > <asp:Web Programmer, Owner />
>> > TeraNet Systems
>> > http://www.teranetsystems.com
>> >
>> > --------Internet E-Mail Confidentiality
>> > Statement--------
>> > The content of and attachment(s) to this electronic
>> > transmission contains
>> > information from TeraNet Systems and is intended for
>> > the use of the person,
>> > firm or entity to which it is directed herein, and
>> > may contain information
>> > that is private, confidential, exempt from
>> > disclosure under applicable law,
>> > and/or proprietary to TeraNet Systems and is
>> > protected by law. If you are
>> > not the intended recipient, or the employee or agent
>> > responsible for
>> > delivering this message to the intended recipient,
>> > any dissemination,
>> > distribution or copying of this communication is
>> > strictly prohibited. If you
>> > have received this message in error, please notify
>> > the sender,
>> > [EMAIL PROTECTED], immediately by reply e-mail
>> > and delete the original
>> > message and any attachment(s) without reading or
>> > saving in any matter. Thank
>> > you for your cooperation.
>> >
>> >
>> > [Non-text portions of this message have been
>> > removed]
>> >
>> >
>>
>>
>> __________________________________________________
>> Do You Yahoo!?
>> Tired of spam? Yahoo! Mail has the best spam protection around
>> http://mail.yahoo.com
>>
>>  ------------------------------
>> YAHOO! GROUPS LINKS
>>
>>
>>    - Visit your group 
>> "AspNetAnyQuestionIsOk<http://groups.yahoo.com/group/AspNetAnyQuestionIsOk>"
>>    on the web.
>>     - To unsubscribe from this group, send an email to:
>> 
>> [EMAIL PROTECTED]<[EMAIL PROTECTED]>
>>     - Your use of Yahoo! Groups is subject to the Yahoo! Terms of
>>    Service <http://docs.yahoo.com/info/terms/>.
>>
>>
>>  ------------------------------
>>
>
>
>
> --
> Thank you,
> Ryan Olshan
> <asp:Web Programmer, Owner />
> TeraNet Systems
> http://www.teranetsystems.com
>
> --------Internet E-Mail Confidentiality Statement--------
> The content of and attachment(s) to this electronic transmission contains
> information from TeraNet Systems and is intended for the use of the 
> person,
> firm or entity to which it is directed herein, and may contain information
> that is private, confidential, exempt from disclosure under applicable 
> law,
> and/or proprietary to TeraNet Systems and is protected by law. If you are
> not the intended recipient, or the employee or agent responsible for
> delivering this message to the intended recipient, any dissemination,
> distribution or copying of this communication is strictly prohibited. If 
> you
> have received this message in error, please notify the sender,
> [EMAIL PROTECTED], immediately by reply e-mail and delete the 
> original
> message and any attachment(s) without reading or saving in any matter. 
> Thank
> you for your cooperation.
>
>
> [Non-text portions of this message have been removed]
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
> 



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/saFolB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to