Change the user name and password for SA in SQL Server 2005

Source: Internet
Author: User
Tags microsoft sql server 2005 management studio microsoft sql server management studio sql server management sql server management studio

The code to modify the database sa account name is as follows:

The code is as follows:
Alter LOGIN SA DISABLE
Alter LOGIN sa with NAME = [Systemaccount]


"Systemaccount" is the new name of SA, refresh the right login after execution to see the successful account name.

SQL Server 2005 How to modify the SA user password method graphic version

I. Ways to modify the SA user password in SQL Server 2005

1. Click "Start-All Programs-Microsoft SQL Server 2005-configuration tools-SQL Server Configuration Manager", open "SQL Server Configuration Manager Window As shown in the following:

2. Open SQL Server 2005 Network Configuration, click on the "SQL2005 protocol (here, use our installed instance name)" Entry as shown in:

3. Right-click on the "Named Pipes" button on the right and click "Enable" in the Popup submenu to bring up the "Warning" dialog box. As shown in the following:

4. Click the "OK" button.

5. Open "SQL Native Client Configuration" and click on the "Client Protocol" entry. As shown in the following:

6. Right-click on the "Named Pipes" button on the right and click "Enable" in the Popup submenu. Close the SQL Server Configuration Manager window.

7. Click "Start-All Programs-Microsoft SQL server 2005-sql server Management Studio" and select "Windows Authentication" in the "Connect to Server" window. As shown in the following:

8. Click the "Connect" button and log in to "Microsoft SQL Server Management Studio".

9. Right-click on the instance name \ (SQL Server 9.0.5000) in the Object Explorer window and select the Properties command from the Popup submenu. As shown in the following:

10. Open the Server Properties window. As shown in the following:

11. Select the security item in the Select page, select the SQL server and Windows Authentication mode entry in Server Authentication, and then click the OK button.

12. In the Object Explorer window, open the security entry, open the login name entry, right-click the SA, and select Properties from the Popup submenu. As shown in the following:

13. Open the Login Properties window. As shown in the following:

14. After changing the password, remove the tick (√) in front of "Enforce Password Policy" and click the "OK" button.

At this point, the password modification of the SA user in SQL Server 2005 succeeds!

15. Start SQL Server Management Studio, and in the Connect to Server dialog box, select SQL Server Authentication. As shown in the following:

16. Enter "SA" in the "Login name" box, enter the modified password, then click the "Connect" button to successfully launch "SQL Server Management Studio"!


II. using SQL statements to modify the password of the SA user in SQL Server 2005
First, start SQL Server Management Studio by using Windows authentication,
Second, select the SQL server and Windows authentication mode item in the Server Properties window,
Then, cancel the "Enforce Password Policy" entry.

Finally, in new query, execute one of the following code:

Code One:

ALTER LOGIN SA ENABLE; GO ALTER LOGIN sa with PASSWORD = ' PASSWORD '; GO

Code two:

ALTER LOGIN sa with PASSWORD = n ' New password '-This can be used: with PASSWORD = N ' 123456 ' old_password = n ' old password '

Code Three:

ALTER LOGIN [SA] with password=n ' newpassword '--can not provide old password--alter login [sa] with password=n ' 123456 '

Change the user name and password for SA in SQL Server 2005

Related Article

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.