I have a database in which some editing operations have to be done manually on some rows. I have the SQL Server Management Studio Express. In SSMS, to edit the rows, normally the option is:
Select DB > Table > Right Click > Edit top 200 rows
But, the problem here is that I only have to edit some selected rows. I am able to retrieve these selected rows by the following query:
/****** Script for SelectTopNRows command from SSMS ******/
SELECT *
FROM [test].[dbo].[Sheet1] WHERE Item1 IS NULL OR Item2 IS NULL
Now, I have to perform some edit operations (moving some data from some columns to others) which can't be performed with a query because of no single observable pattern for editting. So, the question remains, how can I get these rows in edit mode to do my task?
After you have your 200 rows displayed for editing, you can also click on the "SQL" icon which will now be available above the Object Explorer. This is another way to have the SQL displayed which you can now edit as needed in order to change the desired rows.
Click edit rows on the table and then open the sql tab of that query and add your predicate there. And that's how you can edit filtered records.
As you said, go for
Now the window opens with the top 200 query and the results editable.
Now change the query to the one with your where clause and hit F5