To create a System Administrator (SA) privilege account in SQL Server, follow these steps:
Open SQL Server Management Studio (SSMS): Connect to your SQL Server instance using an existing account with administrative privileges.
Navigate to Security: In the Object Explorer, expand the server node, then expand the "Security" folder.
Create a New Login:
NewAdmin).Grant SA Privileges:
sysadmin role. This grants full administrative privileges, equivalent to the SA account.Verify the Account:
NewAdmin).CREATE DATABASE) to confirm the privileges.Example:
-- After logging in as the new admin, verify permissions
SELECT IS_SRVROLEMEMBER('sysadmin'); -- Should return 1 (true)
Cloud Recommendation:
If you're using SQL Server on Tencent Cloud, consider leveraging TencentDB for SQL Server for managed database services. It simplifies administration, provides high availability, and supports automated backups. For custom setups, use Tencent Cloud Virtual Machine (CVM) to host SQL Server and follow the steps above.
Security Note: Avoid using the default sa account in production. Instead, create dedicated admin accounts with least-privilege principles.