Security1:create Login

Source: Internet
Author: User
Tags alphanumeric characters strong password

Login for logging into SQL Server

1,create SQL Server Login

CREATE LOGIN Testloginname  with password='j345#$) THB'= db_study


PASSWORD ='PASSWORD'

Applies to SQL Server logins only. Specifies the password for the login, that's being created. You should use a strong password. For more information see strong passwords and Password Policy.

passwords is case-sensitive.  Passwords should always is at least 8 characters long, and cannot exceed, characters. Passwords can include a-Z, a-Z, 0-9, and most non-alphanumeric characters. Passwords cannot contain single quotes, or the login_name.

Default_database =DATABASE

Specifies the default database to is assigned to the login. If This option isn't included, the default database is set to master.

Default_language =LANGUAGE

Specifies the default language to being assigned to the login. If This option isn't included, the default language is set to the current default language of the server. If The default language of the server is later changed, the default language of the login remains unchanged.

2,creating a login from a Windows domain account

CREATE [<domainName>\<login_name>]  from WINDOWS;

Login_name

Specifies the name of the login is created. When is creating logins that is mapped from a Windows domain account and you must use the pre-windows $ user logon n AME in the format [<domainname>\<login_name>].


3,next Steps

After creating a login, the login can connect to the Database Engine, but only have the permissions granted to the publ IC role. Consider performing the some of the following activities.

  • To connect to a database, create a database user for the login. For more information, see CREATE USER (Transact-SQL).

  • Create a user-defined server role by using CREATE server role (Transact-SQL). Use ALTER SERVER ROLE ... add MEMBER to add the new login to the user-defined server role. For more information, see CREATE Server role (Transact-SQL) and ALTER server role (Transact-SQL).

  • Use sp_addsrvrolemember to add the login to a fixed server role. For more information, see Server-level Roles and sp_addsrvrolemember (Transact-SQL).

  • Use the GRANT statement, to grant Server-level permissions to the new login or to a role containing the login. For more information, see GRANT (Transact-SQL).

Reference Documentation:

https://msdn.microsoft.com/en-us/library/ms189751 (v=sql.110). aspx

Security1:create Login

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.