SQL Server 2008 Express Edition Connection Issue

24,076

Solution 1

you can look for your instance name in SQL Server Configuration Manager. It is written between brackets after SQL Server service in the services list.

the . notation is correct and it's the same as (local)

Solution 2

Start your Local SQL Server Service

  • Start SQL Config Manager: Click Start -> Microsoft SQL Server 2008 R2 -> SQL Server Configuration Manager
  • Start SQL Services: Set the SQL Server (SQLEXPRESS) and SQL Server Browser services to automatic start mode. Right-click each service -> Properties -> Go into the Service Tab

This will ensure they start up again if you restart your computer. Please check to ensure the state is "Running" for both services.

Starting up your Local SQL Server 2008 Service

Login and authenticate with your Local SQL Server

  • Now open up SQL Server Management Studio and click "Connect to Object Explorer" and select Server Name:

[Your PC name]\SQLEXPRESS

Example: 8540P-KL\SQLEXPRESS or (localhost)\SQLEXPRESS

  • To find your PC name: Right click My Computer -> Properties -> Computer Name tab

  • Alternative: Login using windows authentication: Using the user name [Your Domain]/[Your User Name]

SQL Server 2008 User Account Settings

Setup User Account

  • Create a new Login acct: In SQL Mgmt Studio -> Expand your local Server -> Security -> Right click on Logins -> New Login

  • Set Password settings on New User Account: Uncheck Enforce password policy, password expiration and user must change pw(Since this is local) Default database -> Your Database

  • Grant roles to New User Account: User Mapping Page -> Map to your db and grant db_owner role Status Page -> Grant Permission to connect and Enable Login

SQL Server 2008 User Settings Local DB

Setup Access Permissions/Settings for User

  • Enable all auth modes: Right click your Local Server -> Properties -> Security Tab -> Enable SQL Server and Windows Authentication Mode
  • Enable TCP/IP: Open SQL Server Configuration Manager -> SQL Server Network Configuration -> Protocols for SQLEXPRESS -> Enable TCP/IP
  • Restart SQL Server Service: You will have to restart the SQL Server(SQLEXPRESS) after enabling TCP/IP

SQL Server 2008 Server Permissions

Database Properties File for Spring Project

  • database.url=jdbc:jtds:sqlserver://[local PC Computer
    name];instance=SQLEXPRESS;DatabaseName=[db name];

  • database.username=[Your user name] database.password=[Your password]

  • database.driverClassName=net.sourceforge.jtds.jdbc.Driver

If you want to view larger screen shots and better formatting of the answer with more details please view the blog article below: Setting up a Local Instance of SQL Server 2008 Blog Post:

Solution 3

Did you try using (local)\SQLEXPRESS in the name? I've not seen that . notation before.

Solution 4

Scott,

I had to enable SQL Server Browser in services once I did that I was able to connect on My recent install.

after that I only had to use the computer name as the server.

edit, while researching further on finding sql server browser, noted that reporting services, service showed its instance as .\computer name.

try that as the server name.

edit again change to backslash been playing with linux recently :)

Share:
24,076
waqasahmed
Author by

waqasahmed

Ask and all shall be revealed.

Updated on May 27, 2020

Comments

  • waqasahmed
    waqasahmed almost 4 years

    I have VS 2008 Professional Edition. After the installation (which included SQL Server 2008), I decided to install SQL Server 2008 Express Edition with Advanced Tools (so I could get SQL Server Management Studio on it). So I uninstalled the SQL Express that came with VS 2008, and installed the standalone SQL Server Express 2008 version with advanced tools.

    However, When I try to logon onto SQL Server Management Studio using:

    .\SQLEXPRESS
    

    as Server name and Windows Authentication as the authentication, I get the following message:

     TITLE: Connect to Server
     ------------------------------
    
     Cannot connect to .\SQLEXPRESS.
    
     ------------------------------ ADDITIONAL INFORMATION:
    
     A network-related or instance-specific
     error occurred while establishing a
     connection to SQL Server. The server
     was not found or was not accessible.
     Verify that the instance name is
     correct and that SQL Server is
     configured to allow remote
     connections. (provider: SQL Network
     Interfaces, error: 26 - Error Locating
     Server/Instance Specified) (Microsoft
     SQL Server, Error: -1)
    
     For help, click:
     http//go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=-1&LinkId=20476
    
     ------------------------------ BUTTONS:
    
     OK
     ------------------------------
    

    Any suggestions on how to get it to work? I have tried disabling Windows Firewall as well and still no luck. I am using WIndows Vista and SQL Server 2008 Express SP1 Patch has also been applied recently.

    FIX: For those interested: I did not have any of the Instance Based installation installed (i.e. the Database engine). I Installed the instance based stuff and it fixed it!

  • waqasahmed
    waqasahmed about 15 years
    I believe it is something to do with instance. So what do I type in: Just "(local)" - I get error "Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 2)" if so. Any other I get Error 26 again.
  • waqasahmed
    waqasahmed about 15 years
    Apparently, "there are no items to show in this view" in the Sql Server Services section in the Configuration Manager.
  • waqasahmed
    waqasahmed about 15 years
    Is a service not running perhaps? If so, how can I start it? I don't see SQL Server in the services section in Admin tools either?
  • waqasahmed
    waqasahmed about 15 years
    t just shows "There are no items to show in this view." for SQL Server Network Configuration. ANd it has no sub items. In client protocols (in SQL native client 10 configuration section), Shared Memory, TCP/IP and Named Pipes are all enabled. ANd VIA is disabled.
  • Jonathan Simon
    Jonathan Simon about 15 years
    The name of the service should be MSSQLSERVER
  • waqasahmed
    waqasahmed about 15 years
    I don't see it in Windows Services or the Sql Server configuration manager. Is there a way to start it?
  • waqasahmed
    waqasahmed about 15 years
    is there a standalone for SQL Server Surface Area Configuration in 2008 ( i think there was in 2005, can't find it for 2008). But in Configuration Manager, I see no items in SQL Server Services and SQL Server Network Configuration.
  • waqasahmed
    waqasahmed about 15 years
    I can't find "SQL Server Browser" in Windows Services (Admin Tools). How can I start/enable this?
  • Jonathan Simon
    Jonathan Simon about 15 years
    If you don't see it in Windows Services, then it is not installed. You sould try to re-install.
  • DouglasH
    DouglasH about 15 years
    you installed sql server express with advanced tools correct, sql server browser even shows up on the standard install. so it should be in services. if not sounds like something happened with install. not an expert on this fumbled around until I found that in services and it worked even found my sql server instance on the laptop.
  • waqasahmed
    waqasahmed about 15 years
    I am running the installation again. Apparantly, I do not have any of the Instance Based installation installed (i.e. the Database engine). I suspect this is the problem: I will let you know when the installation is complete.
  • waqasahmed
    waqasahmed about 15 years
    Cheers,,, I didn't isntall the instance-based stuff... Thanks
  • kdmurray
    kdmurray almost 15 years
    Also had this problem tonight, and it was the browser service that got it sorted.
  • CRice
    CRice over 12 years
    This fixed my issue, did not need browser service after all.