How to Change the SQL Server Instance Name after Renaming the Windows Host

  • Thanks shashank for the article... it is good.

  • You are welcome 🙂

    Regards
    Shashank Srivastava
    MCITP - SQL SERVER 2008
    INDIA
    Follow me @ http://shashanksrivastavasqldba.blogspot.com/

  • Thank you very much. This was really interesting.

  • You are welcome!!

    Regards
    Shashank Srivastava
    MCITP - SQL SERVER 2008
    INDIA
    Follow me @ http://shashanksrivastavasqldba.blogspot.com/

  • When I connect MS Access to SQL Server I get tables but not data. Maybe the problem is in the server name. I changed the PC and the name of the computer and I use the database from the old computer. With your instructions, I managed to change the server name, but even after restarting SQL Server, I have the old name again. I see this by calling @@ servername! And here I spin in a circle. Is there a solution? Please note that I am new to this environment. Thank you.

    Attachments:
    You must be logged in to view attached files.
  • You (Damir) haven't quite explained well what you did or what you need? If you are getting table names in Access, but not data, you might have a permissions problem. If you cannot connect to the instance or database, potentially it's a name issue, but it is unclear what you did, where you are running SSMS from and where you are trying to connect.

  • Thank you for your reply. Yes, and it seems to me that is a permissions problem But let's go step by step. As I said, I have a new pc on which I installed SQL Server. In the SQL server I ran database scripts that I saved from the old PC. Bases have been created on the new PC. All data is OK. The new (automatic) servername is as shown. Then I changed the name of the PC myself. When I start SQL Server I use windows authentication. SQL Server starts properly. I found the instructions for deleting the servername I missed (sp_dropserver 'Old server Name';). The old name has been removed. Then I started (sp_addserver 'New server name', 'local';). When I call @@ servername I still get the old name. Problems arise on some databases (does not allow diagrams, etc.). Now I'm trying to run the database in Access and it works (I have a table) but no data. The screenshoots are today's. That's the problem!

    Attachments:
    You must be logged in to view attached files.
  • you are connecting with the new name, at least that's what the OE shows. Since I can't see what you ran in which order, it would appear the servername is correct.

    The lack of data has nothing to do with a server name. If Access connects, then the server instance has the right name. If you select from the table in SSMS, is there data?

    Are you using the same account in Access and SSMS?

  • However, I uninstalled and reinstalled SQL Server. All by video at: https://www.youtube.com/watch?v=JXXZsYF-irs. I expected the connection problem to fix, but it didn't !? When I started SQL Server (new), I had all the databases from before as well as all the user settings from the old SQL Server....

    I am so new to this that even this is hard for me to answer: Are you using the same account in Access and SSMS?

  • If you uninstall SQL Server, the data files are still there, but there isn't any linkage from SQL Server to the files. When you reinstall, you need to "attach" the files to the SQL Server instance.

    When you connect from SSMS, you have to choose some account to log into. Access or SSMS are clients, and they will need to log into SQL Server. Usually people use their windows account to log in, if this is added to SQL Server. You could pick this in SSMS, or Access.

    What's not really clear is what you see when you connect or what you are trying to do. Access can be linked to SQL Server tables, or it can have it's own tables, so I'm not quite sure what you have done with it.

    If you log in with SSMS, do you see your databases and tables? Can you query data?

Viewing 10 posts - 31 through 39 (of 39 total)

You must be logged in to reply to this topic. Login to reply