kspearrin
kspearrin

Reputation: 10738

How do I connect to SQL Server 2017 LocalDB?

I've been using (localdb)\ProjectsV13 as part of my VS 2017 installation, however, I recently needed to access some SQL Server 2017 features during development, so I installed SQL Server 2017 LocalDB as well (not part of VS installer still unfortunately). Now I have 2016 and 2017 localdb installed side by side:

enter image description here

How do I connect to this 2017 localdb instance?

Connecting via SSMS, (localdb)\ProjectsV13 and (localdb)\MSSQLLocalDB both still return:

SELECT @@VERSION

Microsoft SQL Server 2016 (SP1) (KB3182545) - 13.0.4001.0 (X64)   Oct 28 2016 18:17:30   Copyright (c) Microsoft Corporation  Express Edition (64-bit) on Windows 10 Pro 6.3 <X64> (Build 16299: ) (Hypervisor) 

(localdb)\ProjectsV14 does not seem to exist (times out when trying to connect).

Upvotes: 11

Views: 14196

Answers (2)

JaYdipD
JaYdipD

Reputation: 38

With SSMS, you should be able to connect to 2017 installation with its instance name, user id and password, that you used during installation of SQL Server 2017

or see this post

SQL Server: How to find all localdb instance names

Upvotes: -1

Bradley Uffner
Bradley Uffner

Reputation: 16991

You can get a list of all instances of LocalDb from the command prompt with the SqlLocalDb.exe program, which is in your PATH by default:

sqllocaldb info

That will list out the available instances. From there you can get additional information about a specific instance with:

sqllocaldb info <instance name>

It will produce output similar to the following:

Name: MSSQLLocalDB
Version: 13.1.4001.0
Shared name:
Owner: DESKTOP-557IFJ5\Bradley Uffner
Auto-create: Yes
State: Stopped
Last start time: 12/4/2017 11:42:58 PM
Instance pipe name:

You should be able to use this information to connect through SQL Server Management Studio.

Upvotes: 11

Related Questions