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?
Right-click the view and select Edit Top 200 Rows. You may need to modify the SELECT statement in the SQL pane to return the rows to be modified. In the Results pane, locate the row to be changed or deleted. To delete the row, right-click the row and select Delete.
By right-clicking on the table name I select the command "Edit Top 200 Rows". By the way, the number of rows loaded with this command can be changed by the option "Tools > Options > SQL Server Object Explorer > Commands > Value for Edit top <n> Rows command". If 0 is entered, all rows or options are loaded.
In SSMS, you can do this by right-clicking the table and selecting “Edit top 200 rows”. You'll be taken to a grid where you can modify the value of each cell.
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
Select DB > Table > Right Click > Edit top 200 rows
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With