Multiple ways to change the user name of SA in Mssql Server2005

Source: Internet
Author: User

MSSQL installed by default is the SA user, most users will always use SA this user, so the database has a great security problem, if we can change the SA user name, so that the security level is a layer higher oh, let's look at the way to modify the SA user name.

The simplest code is as follows

The code is as follows Copy Code

Alter LOGIN SA DISABLE
Alter LOGIN sa with NAME = [Systemaccount]


Leveraging Enterprise Manager

First, run the following code in the Query Analyzer for Enterprise Manager (note that the role of the user name that goes into Query Analyzer is System administrator and is the DB owner for each database):

The code is as follows Copy Code

sp_configure ' allow updates ', 1
Go
RECONFIGURE with OVERRIDE
Go

And then run the following code
Update sysxlogins set name= ' You want to change the name ' where sid=0x01
Update sysxlogins set sid=0xe765555bd44f054f89cd0076a06ea823 where name= ' you want to change the name '

Then:
sp_configure ' allow updates ', 0
Go
RECONFIGURE with OVERRIDE
Go

Then, if you look at the role of SQL Server, you will find the username of the SA, which has been changed to your new name.

Here's a graphic description

Step one, log on to SQL Server 2005 with Windows authentication

After successful login, go to the following screen:

We select the current server,

Select the current server and right-click its properties:

After you right-click its properties, it appears, and then, click Security

In security, select SQL Server and Windows Authentication mode

Just click "OK".

The second step, modify the user sa password:

Click Security--Login name-->sa Then, right-click the SA and click its properties

After you right-click the SA and click its properties, the following picture appears:

In the login properties of the user SA, click General, select SQL Server authentication, and set the login password.

Then, we click the status

In "Status", we select "Enable" in "sign in", i.e. "sign in"---> "Enable". Finally, click OK to finish.

Source: http://www.111cn.net/database/mssqlserver/42245.htm

Multiple ways to change the user name of SA in Mssql Server2005

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.