Reputation: 8413
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?
Upvotes: 3
Views: 30287
Reputation: 97
As I suggest you should use with a full path location, Example:
USE [C:\test.mdf]
GO
Upvotes: -1
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
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
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
Reputation: 8413
Just highlight the database engine you want to use first then click and that's it.
Upvotes: 7