Complete Steps to Change SQL Server Name
In PO Server Configuration, Most of the time we are forget to rename the Computer at the time of installation. it may continue in SQL Installation also.
- Operation system may assign the computer with some letters like DOP-a754fs2g. In SQL installation server name we does not make any changes, we may choose default instance.
- we may find this issue at the time of connect the SQL server
Easy way to Change SQL Server Name
Before do the DOP software configuration, just rename the Server / Computer Name then, SQL server name automatically change if you have selected default instance at the time of SQL Server Installation.
Note: After dop software configuration never try this one, problem may occur with link server and some other configuration.
Steps to Rename in SQL
When one changes the name of the computer running the SQL Server, one needs to perform the following steps to ensure that SQL Server also uses the new updated name.
- First to check whether the SQL Server has the correct name, execute the following query
SELECT @@SERVERNAME AS oldname, Serverproperty('Servername') AS actual_name
- @@Servername gives the computer name that has been set/registered with SQL Server Serverproperty('Servername') provides the newly updated name from windows.
If @@servername,Serverproperty('Servername') results are different then one should update the new name on the SQL Server. To update, follow the steps provided below.
step 1 :- sp_dropserver/sp_addserver
EXEC Sp_dropserver 'oldservername'EXEC Sp_addserver 'newservername' , 'local'
step 2 :- update sysjobs
Applies only for SQL 2k.
USE msdbUPDATE sysjobsSET originating_server = Serverproperty('Servername')
step 3 :- Restart SQL Service
Restart SQL Services for the changes to take effect.