In SQL Server databases, roles and permissions are used to restrict each user's operations on the database. Their role is equivalent to a "Visa". If you do not have a visa, you will naturally not be able to embark on a land outside the motherland. Of course, there is nothing you can say if you are smuggling. The following figure shows my understanding of permissions and roles:
The figure shows that the permissions are based on tables and views in the database. They are allocated from the table and view positions and specify the permissions that can be used to access and manage tables. The role is based on the user. It defines the user role from the user's perspective and defines what role has what permissions. When defining user roles, permissions and role ing, each user has a precise range for database usage, which protects data and facilitates users.