Most Windows users need a SQL Server login to connect to SQL Server. This topic shows how to create a SQL Server login.
To create a SQL Server login that uses Windows Authentication (SQL Server Management Studio)
-
In SQL Server Management Studio, open Object Explorer and expand the folder of the server instance in which to create the new login.
-
Right-click the Security folder, point to New, and then click Login.
-
On the General page, enter the name of a Windows user in the Login name box.
-
Select Windows Authentication.
-
Click OK.
To create a SQL Server login that uses SQL Server Authentication (SQL Server Management Studio)
-
In SQL Server Management Studio, open Object Explorer and expand the folder of the server instance in which to create the new login.
-
Right-click the Security folder, point to New, and then click Login.
-
On the General page, enter a name for the new login in the Login name box.
-
Select SQL Server Authentication. Windows Authentication is the more secure option.
-
Enter a password for the login.
-
Select the password policy options that should be applied to the new login. In general, enforcing password policy is the more secure option.
-
Click OK.
To create a SQL Server login that uses Windows Authentication using Transact-SQL
-
In Query Editor, enter the following Transact-SQL command: CREATE LOGIN <name of Windows User> FROM WINDOWS; GO
To create a SQL Server login that uses SQL Server Authentication (Transact-SQL)
-
In Query Editor, enter the following Transact-SQL command: CREATE LOGIN <login name> WITH PASSWORD = '<password>' ; GO
Tasks
How to: Create a Database User
How to: Create a Database Schema
Concepts
Identity and Access Control (Database Engine)
Principals (Database Engine)
Securing SQL Server
Other Resources
Managing Logins, Users, and Schemas How-to Topics
sys.database_principals (Transact-SQL)
Help and Information
Getting SQL Server 2008 Assistance