What good are SQL Server schemas?

后端 未结 12 1906
青春惊慌失措
青春惊慌失措 2020-11-27 10:43

I\'m no beginner to using SQL databases, and in particular SQL Server. However, I\'ve been primarily a SQL 2000 guy and I\'ve always been confused by schemas in 2005+. Yes

12条回答
  •  攒了一身酷
    2020-11-27 11:14

    In SQL Server 2000, objects created were linked to that particular user, like if a user, say Sam creates an object, say, Employees, that table would appear like: Sam.Employees. What about if Sam is leaving the compnay or moves to so other business area. As soon you delete the user Sam, what would happen to Sam.Employees table? Probably, you would have to change the ownership first from Sam.Employees to dbo.Employess. Schema provides a solution to overcome this problem. Sam can create all his object within a schemam such as Emp_Schema. Now, if he creates an object Employees within Emp_Schema then the object would be referred to as Emp_Schema.Employees. Even if the user account Sam needs to be deleted, the schema would not be affected.

提交回复
热议问题