måndag 5 juni 2017

How to edit the Where-clause in "Edit Top 200 Rows" in SQL Server Management Studio

When you want to edit data in a table directly in the table without writing any update queries, you can right-click the table in the SQL Server Management Studio and select "Edit Top 200 Rows" in the menu.

Then you can go from cell to cell and edit the values for the top 200 rows in a view like the one below.

But what if the top 200 rows aren't the rows you want to edit? You would like add a where clause to select the rows you edit. There is a way, when standing in a "Edit Top 200 Rows" view, a few extra icons are added to the toolbar. Locate the one that has the text SQL on it. Click on it to show an SQL pane.

In the SQL pane you can edit the query as you like. 

When you're done with the query editing, locate and click on the "Execute SQL" button to update the content in the editable table view.

Good luck, have fun! :)

Inga kommentarer:

Skicka en kommentar