Is there a way to get this to default to the following: order by Id descending, or ordering by row creation date descending?
You can easily change this limit by going to MySQL Workbench >> Edit >> Preferences >> SQL Queries tab. Over here you will option to Limit Rows. You can set this to very high value or uncheck the option. When you uncheck that option, it will retrieve all the rows from a query (equivalent to no limits).
Using SQL Server Management Studio In Object Explorer, expand the database that contains the view and then expand Views. 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.
All replies. select <column list you want> from <your table name> order by ProductName offset 100 rows fetch next 100 rows only; That will skip the first 100 rows (in order by ProductName) and return the next 100 rows.
No. The only property that can be modified is the amount of rows under Tools -> Options -> SQL Server Object Explorer -> Value for Select Top < n > Rows command. Please note you can also modify the Edit Top < n > Rows and Select Top < n > Audit records.
You could write a separate stored procedure, add it to your master database, and add a shortcut under Tools -> Options -> Keyboard -> Query Shortcuts. Then in Management Studio, you could highlight the name of the schema and table and run the shortcut. The stored procedure called could then do this for you. Below is a sample stored procedure that would accomplish this goal but orders by the first column instead of a specific column name. You can replace the 1 with a specific column name, but this is likely more flexible for your purposes.
CREATE PROCEDURE dbo.usp_Test_OrderByFirstColumnDesc
@TableName VARCHAR(MAX)
AS
SET NOCOUNT ON;
DECLARE @SqlCommand NVARCHAR(MAX) = N'SELECT TOP 1000 *
FROM ' + @TableName + ' (NOLOCK)
ORDER BY 1 DESC';
PRINT @SqlCommand;
EXEC dbo.sp_ExecuteSQL @SqlCommand;
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