开发者

schema in sql server 2008

开发者 https://www.devze.com 2022-12-17 11:30 出处:网络
what is the difference between creating ordinary tables using \'dbo\' and creating tables using schemas.How this schema works &开发者_开发百科amp; supports the tablesA schema is just a container for D

what is the difference between creating ordinary tables using 'dbo' and creating tables using schemas.How this schema works &开发者_开发百科amp; supports the tables


A schema is just a container for DB objects - tables, views etc. It allows you to structure a very large database solution you might have. As a sample, have a look at the newer AdventureWorks sample databases - they have a number of schemata included, like "HumanResources" and so forth.

A schema can be a security boundary, e.g. you can give or deny certain users access to a schema as a whole. A schema can also be used to keep tables with the same name apart, e.g. you could create a "user schema" for each user of your application, and have a "Settings" table in each of them, holding that user's settings, e.g. "Bob.Settings", "Mary.Settings" etc.

In my experience, schemata are not used very often in SQL Server. It's a way to organize your database objects into containers, but unless you have a huge amount of database objects, it's probably something you won't really use much.


dbo is a schema.


See if this helps.

Schema seems to be a way of categorizing objects (tables/stored procs/views etc).
Think of it as a bucket to organize related objects based on functionality.

I am not sure, how logged in SQL user is tied to a specific schema though.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号