Click to Rate and Give Feedback
MSDN
MSDN Library
SQL Server
SQL Server 2008
Database Engine
Principals
 How to: Create a SQL Server Login

  Switch on low bandwidth view
Community Content
In this section
Statistics Annotations (0)
Other versions are also available for the following:
SQL Server 2008 Books Online (June 2009)
How to: Create a SQL Server Login

Most Windows users need a SQL Server login to connect to SQL Server. This topic shows how to create a SQL Server login.

  1. In SQL Server Management Studio, open Object Explorer and expand the folder of the server instance in which to create the new login.

  2. Right-click the Security folder, point to New, and then click Login.

  3. On the General page, enter the name of a Windows user in the Login name box.

  4. Select Windows Authentication.

  5. Click OK.

  1. In SQL Server Management Studio, open Object Explorer and expand the folder of the server instance in which to create the new login.

  2. Right-click the Security folder, point to New, and then click Login.

  3. On the General page, enter a name for the new login in the Login name box.

  4. Select SQL Server Authentication. Windows Authentication is the more secure option.

  5. Enter a password for the login.

  6. Select the password policy options that should be applied to the new login. In general, enforcing password policy is the more secure option.

  7. Click OK.

  1. In Query Editor, enter the following Transact-SQL command: CREATE LOGIN <name of Windows User> FROM WINDOWS; GO

  1. In Query Editor, enter the following Transact-SQL command: CREATE LOGIN <login name> WITH PASSWORD = '<password>' ; GO

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Using SMO + C#      RamyMahrous   |   Edit   |   Show History
I've created sample of how to create SQL Server login using C# (SMO)
http://ramymahrous.wordpress.com/2009/04/28/how-to-create-sql-server-login-programmatically/ because I didn't find any sample on MSDN

Tags What's this?: c# (x) login (x) server (x) smo (x) sql (x) Add a tag
Flag as ContentBug
creare login      juno tiwari   |   Edit   |   Show History

To create a SQL Server login that uses choose 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


or query
create login <login name> with password='<passwordname>'

Flag as ContentBug
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker