Issue :- We have changed the windows machine name from Ahsi-PC to Shashank but when we look for the SQL Server name it will give the old windows machine name.
Step 1 : Run sp_dropserver 'Old server Name'on master database
Step 2 : - Run sp_addserver 'New server name','local' on master database. After running restart the SQL services.
Step 3 :- Check the new name of the instance by running select @@servername.
Now the SQL instance name has been changed after windows name change. Minimum rights required to perform the above action is setupadmin server role.