THE SQL Server Blog Spot on the Web

Welcome to SQLblog.com - The SQL Server blog spot on the web Sign in | |
in Search

Buck Woody

Carpe Datum!

Use Those Schemas, People!

Database Schemas are just containers – they aren’t users or anything else – think of a sub-directory on the hard drive. In early versions of SQL Server we “hid” schemas, placing all objects under “dbo”, which gave the erroneous perception that Schemas are users.

In SQL Server 2005, we “un-hid” or re-introduced schemas within the database. Users can have a default schema (a place where their new objects go), you can add new schemas and transfer objects between them, and they have many other benefits.

But I still see a lot of applications, developed by shops I know as well as vendors, that don’t make use of a Schema. Everything is piled under dbo. I completely understand this – since permissions can be granted to a schema, they feel a lot like a user, so it’s just easier not to worry about both users and schemas when you create a database. But if you’ll use them properly you can make your application more understandable and portable.

You should at least take a few minutes and read more about them – you owe it to your users: http://msdn.microsoft.com/en-us/library/ms190387.aspx

Published Tuesday, May 18, 2010 6:39 AM by BuckWoody

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

 

DT1984 said:

No thanks - I've found schemas to not only be not very useful, but a hinderance....

May 18, 2010 10:02 AM
 

BuckWoody said:

May 18, 2010 10:09 AM
 

Adam Machanic said:

Good, he can be ignored :-)

May 18, 2010 10:12 AM
 

BuckWoody said:

DT1984 - Thanks for the comment and for reading!

I think that's the great thing about Microsoft products - you don't HAVE to do it this way. You have all the flexibility in the world.

May 18, 2010 10:19 AM
 

James Luetkehoelter said:

Personally, I find them useful if used by a DBA, a hinderence if used by development...

May 18, 2010 12:15 PM
 

Alexander Kuznetsov said:

I use schemas to simplify granting permissions. For tables and views, I have three schemas: Data, the

May 18, 2010 2:35 PM

Leave a Comment

(required) 
(required) 
Submit

About BuckWoody

http://buckwoody.com/BResume.html

This Blog

Syndication

Powered by Community Server (Commercial Edition), by Telligent Systems
  Privacy Statement