Search code examples
sql-serverssmsssms-2017

How to re-run the query in the SQL Server Management Studio "Edit Top ### Rows" window


I am editing a table row in SSMS, and when the row committed, it appeared tan-colored instead of black with a red exclamation mark indicating that there was a problem attempting to get the data back after the row committed.

enter image description here

It says to re-run the query, but I don't know how to do that, other than to close the window and re-load it via the context menu:

enter image description here

The "Execute" button is grayed out on the "SQL Editor" toolbar, and F5 doesn't work either.

enter image description here

How do you re-load or re-fresh the data in situ?


Solution

  • Try going to the "Query Designer" menu and clicking "Execute SQL".

    I've never known this until just now, but it seems that the "Edit Top 200 rows" area you're in has query-builder options (such as "Add Table" and "Add Group By"), and you can press ctrl + 3 to get the sql statement involved. I even changed the Select Top (200) statement to Select Top 2 and produced an order by statement and it still produced an editable viewer, which I confirmed registered the edit.