Link to home
Start Free TrialLog in
Avatar of hefterr
hefterrFlag for United States of America

asked on

Usage of "Schema" names

Hi,
I am somewhat a newbie to SQL Server administration as I am now doing everything for a very small company.

I have a database the has the need for 2 "Organization" tables.  One is a "Customer Organization" table (What organization the customer belongs to).  The other is a "Global Organization" table.  Let's accept that they have to be different tables.

Within a database, what are the ramifications between the 2 sets of names:
Database: myCompany
table:  dbo.Cust_organization
table:  dbo_Global_Organization
OR
Database: myCompany
table:  Cust.Organization
table:  Global.Organization

And what is the ramification of making a separate database (when would I do that)?
Database : myCompany
table: dbo.Organization

Database : Global
table: dbo.Organization

Any advise would be appreciated,
hefterr
Avatar of JestersGrind
JestersGrind
Flag of United States of America image

The difference is largely personal choice.  It depends on how your security is setup.  To give you another option, you could even have one table with a column that differentiates between customer and global, if the columns are the same.  

Using different schemas allows a logical grouping of objects and you can assign permission to the schema to only allow users to use that schema.  

With separate tables, you can still assign permissions to only the appropriate table, but you would have to assign permissions individually to each object instead of one like the schema method.

With separate databases, you can complete separate the data.  This might mean that you have duplicate tables in each to accommodate the design.  Also, need separate backups, etc...

Greg

Avatar of hefterr

ASKER

Hi JestersGrind,
Thanks for the quick response.

On the topic of security, as a web application all public users have the same security.  So you are talking about developers, DBA I assume?

...Using different schemas allows a logical grouping of objects and you can assign permission to the schema to only allow users to use that schema.  
Q:  Is this a common procedure for just "grouping" as this is what I would be using it for.

Q:  If a table was shared by different sites/applications, would it be more of a candidate for a separate DB?  Or is that not significant?

Thanks again,
hefterr

ASKER CERTIFIED SOLUTION
Avatar of JestersGrind
JestersGrind
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of hefterr

ASKER

Thanks!