Creates a new SQL Server login to connect using SQL Server authentication. Note: Microsoft states that this function will be deprecated in future release in favor of using Windows Authentication.
sp_addlogin [ @loginame = ] 'login'
[ , [ @passwd = ] 'password' ]
[ , [ @defdb = ] 'database' ]
[ , [ @deflanguage = ] 'language' ]
[ , [ @sid = ] sid ]
[ , [ @encryptopt = ] 'encryption_option' ]
[;]
GO
--returns 0=ok 1=failed
Creating a SQL Server login
EXEC sp_addlogin 'ericm', 'bluefin87'; GO
Creating a SQL Server login that has a default database
EXEC sp_addlogin 'ericm', 'bluefin97', 'hcmdatamart'; GO
SQL Server logins can contain:
