I want to change the owner of the object.............

  • Hello friends!

    I want to change the owner of the object

    I have table whose owner is dbo but i want to change it to hov

    can u please tell me complete syntax of that

    Also when we right click on table and select design table , here we find menu like Trigger then Show permission then show dependency like that

    If I chose show permission here we find list all users/userdefined database roles/public like that , can u please explain that thing (window) to me what that mean by?

    T.I.A

    Shashank


    Regards,

    Papillon

  • The permissions window shows which users and roles in the database that have rights to the trigger.

    To change the owner of an object you use the system stored procedure sp_changeobjectowner.

    EXEC sp_changeobjectowner 'foobar', 'hov'

    Where foobar is the name of the object to change owner of. However, in general you want to have dbo as user of all objects. There are definitely valid exceptions, but sometimes people want to have different owners just because that is how it is done in other database management products.

  • Hi Chris

    I did what u tell me but that gives me error like

    Object 'orgdetail' does not exist or is not a valid object for this operation.

    i used query like

    EXEC sp_changeobjectowner 'orgdetail', 'hov'

    please help me

     

    shashank

     


    Regards,

    Papillon

  • What sort of object is 'orgdetail' ??

     

    --------------------
    Colt 45 - the original point and click interface

  • Its name of table having details of students (like Studend_Id,Student_Name,Address,E-Mail .....)

    I want to change owner from 'dbo' to 'hov'

    i cannot do that why??

     


    Regards,

    Papillon

  • Are you sure that you are currently working in the correct database? Issue a USE databasename first.

  • I will tell detail ,

    I created table 'orgdetail' but by default the owner became 'dbo' now i want just change that to 'hov'

    my database is same as i created the table there only i am working!!

     

     

     

     

     

     


    Regards,

    Papillon

  • Like I said, in general the user who owns the objects in your database should be dbo. Do you have a specific reason for needing to change it?

    What tool are you using to enter the commands I mentioned above, and how are you logged in?

  • When you're executing the command, are you logged on as a user with dbo permissions, or as this user hov?

    You could try qualifying the name of the table in the command.

    EG: EXEC sp_changeobjectowner 'dbo.orgdetail', 'hov'

     

    --------------------
    Colt 45 - the original point and click interface

Viewing 9 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply