SQL Server Performance

About object privilege

Discussion in 'General DBA Questions' started by Jelly0228, May 11, 2003.

  1. Jelly0228 New Member

    I had created a database and there is a user "A" in it.
    user "A" isn't a member of db_owner.
    But when I create any objects with user "A",I want to appoint "DBO" to the object's owner,
    how to do it ?

    Thanks for any sugguestion.

    Jelly is here.
  2. gaurav_bindlish New Member

    I think you can do this using sp_changeobjectowner.
    But note:
    Only members of sysadmin fixed server role, the db_owner fixed database role, or a member of both the db_ddladmin and db_securityadmin fixed database roles can execute sp_changeobjectowner.

  3. satya Moderator

    ... also make sure to script the permissions if you're changing any of the privileges for any object to be on safe side.

    Satya SKJ
  4. Jelly0228 New Member

    Thanks for your help.
    Now I want to appoint "DBO" to the object's owner when I create any object with user "A",not change the owner after create the object.and I just granted the privileges of create view©pcreate procedrue to user "A".

    I can execute the script with user "A" like this:
    CREATE VIEW view_name as
    my code ...

    but I can't execute the script with user "A" like this:
    CREATE VIEW [dbo.]view_name as
    my code ...

    It shows me an error message:
    Specified owner name 'dbo' either does not exist or you do not have permission to use it.

    Many thanks for any help.

    Jelly is here.

Share This Page