Schema in SQL Server 2008

What is the difference between creating regular tables using "dbo" and creating tables using schemas. How this scheme works and maintains tables

+3
source share
3 answers

A schema is just a container for database objects - tables, views, etc. It allows you to structure a very large database solution that you may have. As an example, check out the newer AdventureWorks database examples — they have a number of included schemas, such as HumanResources, etc.

A circuit may be a safety margin, for example. You can give or deny certain users access to the entire scheme. You can also use a schema to split tables with the same name, for example. you can create a “user scheme” for each user of your application and have a “Settings” table in each of them, holding these user settings, for example. "Bob.Settings", "Mary.Settings", etc.

In my experience, schemas are not used very often in SQL Server. This is a way to organize database objects in containers, but if you do not have a large number of database objects, it is possible that you are unlikely to use a lot.

+6
source

dbo is a diagram.

+3
source

, .

A schema is apparently a way to categorize objects (tables / stored procs / views, etc.).
Think of it as a bucket for organizing related objects based on functionality.

I am not sure how a registered SQL user is bound to a specific schema.

+1
source

Source: https://habr.com/ru/post/1728874/


All Articles