Results 1 to 4 of 4

Thread: [RESOLVED] [dbo] vs [erp] tables

Hybrid View

  1. #1
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    6,183

    Re: [dbo] vs [erp] tables

    [erp] and [dbo] are different schemas. Think of this as namespace in .Net, a logical separation of db object that object names accross different schemas do not collide. Another possible use of db schemas is permission assignment -- a user can have read/write permissions on [erp] schema but read-only on [dbo] or no access at all.

    When creating and accessing objects in your db (tables, views, sps, etc.) you can prefix object name with optional schema name like CREATE TABLE erp.MyTable or CREATE PROC dbo.usp_MyProc

    When schema is omitted from object names query planner uses default schema for the current db user which is dbo for sa login (server administrators) and this default resolution might fail for non-admins and/or lead to permission problems.

    cheers,
    </wqw>

  2. #2

    Thread Starter
    Still learning kebo's Avatar
    Join Date
    Apr 2004
    Location
    Gardnerville,nv
    Posts
    3,762

    Re: [dbo] vs [erp] tables

    Quote Originally Posted by wqweto View Post
    [erp] and [dbo] are different schemas....
    cheers,
    </wqw>
    Thank you for that.
    For others who may stumble on this, if the schema does not exist, you cannot create a table in it. You can create schemas using this,
    CREATE SCHEMA schemaName
    kevin
    Process control doesn't give you good quality, it gives you consistent quality.
    Good quality comes from consistently doing the right things.

    Vague general questions have vague general answers.
    A $100 donation is required for me to help you if you PM me asking for help. Instructions for donating to one of our local charities will be provided.

    ______________________________
    Last edited by kebo : Now. Reason: superfluous typo's

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width