# Renaming a Linux SQL Server Name

Before performing tasks such as changing the name of the Linux computer where the CommServe resides, you can rename the stand-alone instance of SQL to your requirement.

To change the SQL server instance name change drop the existing SQL server instance name from the system metadata then add the new name using command line procedures.

## Procedure

1. Connect to the SQL Server instance using the sqlcmd utility and enter the password.

       sqlcmd -S $[Hostname_of _Linux Computer] -U $[sa]

   Parameters:

   - S: Linux Server hostname

   - U: SQL server username or sa username

2. Review the SQL server name.

       SELECT $[@@SERVERNAME]

       Go

   The old server name appears.

3. Drop the existing SQL Server instance name from system metadata.

       sp_dropserver $[Old_SQL_Server_Instance_Name]

       Go

4. Add a new instance name to the system metadata.

       sp_addserver $[New_SQL_Server_Instance_Name], local

       Go

5. Exit the SQL Server session.

       Exit

6. Restart the SQL Server service.

       systemctl restart mssql-server

7. Optional: Review the new name of the SQL server instance by performing steps 1 and 2.

   The new name assigned to the SQL server instance appears.

×

Loading...