locked
schema dbo vs. username RRS feed

  • Question

  • I'm using Mgmt Studio Express to access my companies SQL system.  When I create a table on one of the DB's my schema is not DBO.  Is it possible for me to change my default schema if I am not an owner or sa, or do I need the administor of the DB to do this. 

     

    When I create my table it appears as

    doman/username.table_name

    When I right click the table and select veiw table I can see the data, however if I try to hit the table with a select query it blows up on me.

     

    However, I am able to run select queries on all other tables in the DB non of which I created, but they all have a dbo schema

    dbo.table_name

    Monday, July 14, 2008 2:55 AM

Answers

  • Please refer the link, http://msdn.microsoft.com/en-us/library/ms187359.aspx to change the schema owner using Alter authorization statement.
    Permission:
    Requires TAKE OWNERSHIP permission on the entity. If the new owner is not the user that is executing this statement, also requires either, 1) IMPERSONATE permission on the new owner if it is a user or login; or 2) if the new owner is a role, membership in the role, or ALTER permission on the role; or 3) if the new owner is an application role, ALTER permission on the application role.

    - Deepak
    Monday, July 14, 2008 3:06 AM