Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change the order by when selecting "edit top 'N' rows"

I want to know if it is possible to change the ordering of the results when you right click a table in SSMS and select "edit top 'n' rows".

I have noticed it defaults the 'order by' to the first column.

Unfortunately I am manually updating records and it would save many hours if i could re order it to a column which maps directly to my Excel spreadsheet.

NOTE: I know how to change the number of rows I can edit (hence the reason i have used 'n' instead of the default: 200).

I just want to know if it is possible, perhaps from someone who knows the internals of it. I was hoping there is some script it executes and I could edit that script ?

Thanks in advance

like image 298
EaziLuizi Avatar asked Jul 01 '14 09:07

EaziLuizi


People also ask

How do I change the edit top 200 rows in SQL Server?

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.

How do I change the order of rows in SQL Server?

You can change the order of the rows by adding an ORDER BY clause at the end of your query, with a column name after. By default, the ordering will be in "ascending order", from lowest value to highest value. To change that to "descending order", specify DESC after the column name.

How do I change the top 1000 rows in SQL?

By default in SSMS, you can select 1000 Rows and Edit 200 Rows. If you would like to change the default value then go to SSMS > Tools > Options: In the Options dialog box, highlight SQL Server Object Explorer and change the default values to any number as per your requirements.

How do I change the order of SQL?

Using SQL Server Management StudioIn Object Explorer, right-click the table with columns you want to reorder and select Design. Select the box to the left of the column name that you want to reorder. Drag the column to another location within the table.


1 Answers

You can right click on your result and select pane\SQL and then change your order and top amount of your query.

like image 153
mehdi lotfi Avatar answered Sep 29 '22 16:09

mehdi lotfi