Why can I continue to query while the server is offline?

advertisements

I'm using SQL Server Management Studio.

I log in my server, open a "new request" window and write a query that select ALL the element of a table.

SQL Server then display a table with the content queried.

However, as this request work when i'm connected, which is perfectly logic, i don't understand why this request still work when i disconnect from the server.

Is it a normal behavior ? When i disconnect from a server it's specifically to not execute a query by accident.


When you say disconnect, do you mean on your server connection on the left plane or on the current query you are on? Because a query can be open with a seperate connection to a database than from your left databases pane. It can be empty because that list's connection has been disconnected but the queries that are open run in a separate window and use a seperate connection –

Right click on your query window, go to connection and select disconnect then the query will not be able to run

When you open a query on the current database they will use the connection details, but they use a seperate connection to the database, so if you close your conneciton on the left databases pane. your query still has its own connection open