How to change sa user name in SQLServer

Source: Internet
Author: User

First, run the following code in the query Analyzer of the Enterprise Manager. (Note that the user name used to enter the query analyzer must be System administrator and the database owner of each database ):
Copy codeThe Code is as follows:
Sp_configure 'Allow updates', 1
Go
RECONFIGURE WITH OVERRIDE
Go

Then run the following code:
Copy codeThe Code is as follows:
Update sysxlogins set name = 'the name you want to change to 'where sid = 0x01
Update sysxlogins set sid = 0xE765555BD44F054F89CD0076A06EA823 where name = 'name you want to change to name'

Next:
Copy codeThe Code is as follows:
Sp_configure 'Allow updates', 0
Go
RECONFIGURE WITH OVERRIDE
Go

Then, check the role of SQL SERVER and you will find that the SA user name has been changed to your new name.

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.