Confused Logins and Users in SQL Server In SQL Server, when setting permissions with a Grant statement, we do it on Users, not Logins. For example:

CREATE LOGIN login1 WITH PASSWORD = 'sssssssss';
use mydb;
CREATE USER user1 FOR LOGIN login1
grant delete on table1 to user1


So, users may or may not be able to do a certain task on a certain table.
But, when connecting to a database from JDBC and etc, we give the login name and the password (login1 and 'sssssssss' in here) in the connection string, not the User name!

So where do these grant statements show themselves?! We never mentioned User1 in the code! And, if we define two users for same login, each with different permissions, and then connect to database from JDBC, which of these user permissions are considered?
A SQL Server login is used to authenticate the principal at the server level, and to provide server level permissions.

A database user maps to zero or one login and is used to provide a security context within the database.  Database permissions are assigned to database principals, including roles, not directly to logins.

User names are generally not specified in connection strings.  The exception is when a user is authenticated at the database level, and therefore has no login.