SQL Interview: 20: Difference between a login and a user

This is a post in the SQL Interview series. These aren’t trick or gotcha questions, they’re just questions designed to scope out a candidate’s knowledge around SQL Server and Azure SQL Database.
Section: Security Level: Intro
Question:
SQL Server can use both logins and users.
What is the difference between them?
Answer:
A login provides access to the server, but not necessarily to any databases.
A user is used to provide access to a database. It might be mapped to a login, but it is possible for databases to authenticate users directly.
Other special types of users can also exist.
2025-02-11