HiveBrain v1.2.0
Get Started
← Back to all entries
snippetsqlModerate

Create table group sub-folders in Management Studio

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
creategroupsubfoldersstudiomanagementtable

Problem

When I was exploring the master database in SSMS I noticed that under the Tables folder there is another folder called Systems Tables that houses a bunch of tables. Is it possible for us to create a structure akin to Systems Tables within our database?

I am looking to organize tables and stored procedures into project specific folders. Under the new setup - when I am referring to my table object I would have to use the following syntax (I am guessing here):

[dbName].[projectName].[dbo].[tableName]


Also, apart from clearing up the clutter, do anybody foresee any performance improvement/degradation because of this re-organization? I use Microsoft SQL Server 2008 R2.

Solution

There is no way to create custom folders directly in SQL Server Management Studio.

Here are a few common strategies:

  • Group database objects by schema to help one-dimensional organization



  • Name objects from broad to specific areas



For the 1st option:

billing.Product
billing.Receipt
internal.Employee
internal.Office


Schemas are most primarily used to logical grouping of database objects, and can also provide an extra layer of security when using more than just the out-of-the-box configuration. And the secondary benefit is, of course, the grouping of these items within SSMS Object Explorer.

For the 2nd route (name objects from broad to specific), it'd be something like this:

dbo.Animal
dbo.AnimalDiet
dbo.AnimalDietFootType
dbo.AnimalHabitat
dbo.Person
dbo.PersonAddress
dbo.PersonAutomobile
dbo.PersonAutomobileArchive


So on an so forth. You can see that these objects alphabetically order themselves. It's not just good for visual organization, but a great naming convention in my opinion.

Code Snippets

billing.Product
billing.Receipt
internal.Employee
internal.Office
dbo.Animal
dbo.AnimalDiet
dbo.AnimalDietFootType
dbo.AnimalHabitat
dbo.Person
dbo.PersonAddress
dbo.PersonAutomobile
dbo.PersonAutomobileArchive

Context

StackExchange Database Administrators Q#44992, answer score: 10

Revisions (0)

No revisions yet.