Adrian Enriquez
Adrian Enriquez

Reputation: 8413

Database does not exist. Make sure that the name is entered correctly

Why am I having this error? If you looked at the screenshot, you will see the database. It only happens when I am connected to two database engines. It only detects the databases from database engine below not the one highlighted.

Is there a way to use my database other than closing the application and opening just one database engine?

enter image description here

Upvotes: 3

Views: 30287

Answers (5)

Sami Alkendi
Sami Alkendi

Reputation: 97

As I suggest you should use with a full path location, Example:

USE [C:\test.mdf]
GO

Upvotes: -1

Malith Thisara
Malith Thisara

Reputation: 1

I received this error a few times, because I replaced the MDF file many times in the app_data folder. I deleted the db connection from the server explorer and again add it as same as before.Then SQL data source works well.

Upvotes: 0

Bridge
Bridge

Reputation: 30651

You can also re-direct which server your query window is pointing at in SSMS without starting a new one and copy/pasting:

Query menu -> Connection -> Change connection

Upvotes: 1

AaronYuan
AaronYuan

Reputation: 21

You should be able to look at which server you're currently linked to at the bottom right corner of the window. Most likely it's linked to another server. You can select the server you want and then click on New Query and then just copy and paste the code.

Upvotes: 2

Adrian Enriquez
Adrian Enriquez

Reputation: 8413

Just highlight the database engine you want to use first then click New Query and that's it.

Upvotes: 7

Related Questions