SQL Server database schemas

I use schemas in my databases, but other than the security benefits and the fact that my OCD is happy, I don't know how well to use them. Besides better security, are there other reasons for using schemas when creating a database?

+2


source to share


2 answers


The primary schema confusion is really security. The second advantage is that they act as namespaces for your application and object tables, which allows conflict without lateral deployment with other applications that might use the same name for their object.



+3


source


The schema appeared on the original Sql server. They didn't have schemas, which meant that every single object in the database had to be owned by someone. If the lesson from accounting left the company, then you had to manually reassign all of its things to someone else, etc. Now schemas have their own objects and users belong to schemas, which makes all DB addons very happy people :).



Basically, you can keep users and remove your privileges by removing them from schemas and deleting the user. Adding privileges to a user is now as easy as adding a user to the schema.

+1


source







All Articles