21

enter image description here

enter image description here

I have installed SQL Server Management Studio 2005. I can't find my server name when I click browse for more but i know that my server name will be the same as the user name as in the picture below.

Abid Ali
  • 1,731
  • 8
  • 26
  • 62
  • 4
    if this is sql express try the name: Abid-PC\sqlexpress (or .\sqlexpress) – Menahem May 15 '11 at 07:01
  • 2
    Have you bothered to check the nearly **5000** other posts on this site relating to the same thing? Check this search URL: http://stackoverflow.com/search?q=sql+network-related+instance+error+occurred+26 – slugster May 15 '11 at 07:11
  • 2
    possible duplicate of [Connection error in sql server 2005](http://stackoverflow.com/questions/2118466/connection-error-in-sql-server-2005) – slugster May 15 '11 at 07:11
  • Possible duplicate of [How to connect to local instance of SQL Server 2008 Express](http://stackoverflow.com/questions/360141/how-to-connect-to-local-instance-of-sql-server-2008-express) – Abob Mar 14 '17 at 20:29
  • When use a local server. try with server name: (localdb)\\mssqllocaldb. It's working for me. – Billu Oct 20 '22 at 19:49

3 Answers3

55

Use . or (local) or localhost for server name if you installed the server as default instance.

Use .\sqlexpress or localhost\sqlexpress if you have SQL Express.

The server name syntax is

Servername\InstanceName

If the instance is default you use just Servername.
For SQL Express, instance name is sqlexpress by default.

Alex Aza
  • 76,499
  • 26
  • 155
  • 134
  • @Abid Ali - did you find the solution to your problem? – Alex Aza May 18 '11 at 17:49
  • May I ask you why do I have to service in my sql server2008. I view the my Sql Server Configuration Manager and go to the SQL Server Network Configuration. I find I have TWO options under it. Protocals for MSSQLSERVER and Protocals for SQLEXPRESS. But as I log in, nothing notice me about that so I just get serious confusion in how to enter the correct Sever name: localhost or localhost\InstanceName. If I don't stop one service, my log in process will be complex. If you are willing to answer it. I'm very glad to post a question, and if you know – Alston Sep 11 '12 at 14:40
  • I think you know since you r a Software Engineer at .NET 4, MS SQL 2008.(from ur profile) Please tell me if you resolve my question or not, and I will post the issue to share with people with the same confusion. Thanks. – Alston Sep 11 '12 at 14:41
  • What if the port is different than 1433? Does it go after the server_name or the instance_name? e.g. server,1434\instance, or server\instance,1434. – software_writer Sep 19 '20 at 02:51
2

Please see:

Mitch Wheat
  • 295,962
  • 43
  • 465
  • 541
0

Using Local server with .Net 6 project, follow these two simple steps.

Step1: Check appsettings.json file with this settings

{
    "Logging": {
        "LogLevel": {
            "Default": "Information",
            "Microsoft.AspNetCore": "Warning"
        }
    },
    "AllowedHosts": "*",
    "ConnectionStrings": {
        "MvcMovieContext": "Server=(localdb)\\mssqllocaldb;Database=YourDBName;Trusted_Connection=True;MultipleActiveResultSets=true"
    }
}

Step 2: In SQL SERVER Management Studio you should use "(localdb)\mssqllocaldb" as Server name. enter image description here

Billu
  • 2,733
  • 26
  • 47