views:

71

answers:

2

Often I am frustrated by the fact that there are a lot of tables, views, stored procedure all placed under one hierarchy. I am looking for a way (like namespaces) that would group related tables under one banner. This would not only be easy to understand. Also i would avoid the need for coming up with fancy names. I am not aware of any present trick to achieve this, Kindly help me if there is way I can use to achieve the similar effect.

Thanks

+1  A: 

If you are using SQL 2000, you are stuck with either using database owners as namespaces, which is painful because it requires you to contrive users just for their namespaces.

In SQL 2005, you can create schemas, which are essentially name spaces.

In all SQL databases you can use prefixes, e.g. hr_ for human resources, sys_ for system related, etc.

MatthewMartin
There you have your database namespaces - just use them! :-)
marc_s
A: 

I don't think there's a need for namespaces in databases, because the "namespace" by default is usually the database name. Usually in any application there's a lot more "functionality" that needs to be grouped than underlying data, so the namespace concept works better for code than it does for data storage.

However, if you wanted to do this with your tables, SQL does support periods (.) in the table name, so you could have Contacts.Address or something like that if you wanted.

Usually though, if you have this many tables, I would think your table name will essentially be the "namespace" + table name without the period (i.e. ContactAddress).

routeNpingme