About
A login can:
- join a role
- be authorized to use a database, see Create a Database User.
- be granted permission
The database user is the identity of the login when it is connected to a database. The database user can use the same name as the login, but that is not required.
Articles Related
Management
Create
SQL
Create Statement: Create a login
- Azure SQL
CREATE LOGIN loginName WITH
PASSWORD = 'pwd';
- SQL Server
CREATE LOGIN loginName WITH
PASSWORD = 'pwd',
DEFAULT_DATABASE = DefaultDatabase;
Built-in Procedure
- With the the sp-addlogin function. Example: creates a SQL Server login for the user userName, with a password of pwd and a default database of defaultDatabaseName
EXEC sp_addlogin 'userName', 'pwd', 'defaultDatabaseName';
GO
Drop
Password
ALTER LOGIN login_name WITH PASSWORD = 'pwd'
List
- SQL Azure
SELECT * from master.sys.sql_logins;