Additional SQL Server features and topics not covered by specific categories
Hi @Maninder Karjee ,
From your description (save and refresh not changing the result), this is almost certainly not SQL Server misbehaving. It's how SSMS works.
The results grid never updates on its own. Save (Ctrl+S) only saves the .sql file to disk, and Refresh only reloads the Object Explorer tree. Neither of them runs your query. The result you see is always from the last time you pressed Execute. So check these:
- After modifying a query, click inside the query window and press Execute (or F5) again. That is the only thing that produces a new result.
- Watch out for highlighted text. If any part of the query is selected, Execute runs only the selected portion, not the whole script. So if an old line is still highlighted, you keep re-running the old query. Click once anywhere in the editor to clear the selection, or select the full modified query, then Execute.
- Check the database dropdown at the top left of the query window. If it says master or a different database, your query is running against the wrong database, so your changes won't show. Switch it to the correct one or add USE YourDatabaseName at the top.
- If what you modified is a view or stored procedure, editing the text isn't enough. You have to execute the ALTER VIEW / ALTER PROCEDURE statement first, then run your SELECT or EXEC again to see the new logic.
- Make sure you're executing in the same tab you edited. Each tab has its own results pane, so editing in one tab and reading results in another looks exactly like "nothing changed".
If instead the query genuinely hangs showing "Executing..." forever, that's a different issue, usually an open transaction in another window holding locks. Run COMMIT or ROLLBACK in the window where you ran a BEGIN TRAN, or close the other windows, and it will unblock.
If none of these apply, reply with the exact query, which button you press to run it, and a screenshot of the full SSMS window, and we can dig further.