Tables. How to do sorting in AS CRUD

For columns that can be sorted set Sorting = Yes

In the getItems stored procedure, we configure sorting in #result
DECLARE @result TABLE (id int, name nvarchar(256), code nvarchar(64)
                       created nvarchar(64), hide_created datetime)
                                            --temporary hide_created for sorting

insert into @result
select top 2 id as id,
           name as name,
           code as code,
           convert(nvarchar, created, 104) as created,
           hide_created as hide_created
from as_trace

select * from @result
order by
        --for each field we specify 2 times sorting up and down
	case when @sort = 'name' and @direction = 'down' then name end desc,
	case when @sort = 'name' and @direction = 'up' then name end asc,
        --'hide_created' put in the expression then then as the field that you need
        --sort 'created'
	case when @sort = 'created ' and @direction = 'down' then hide_created end desc,
	case when @sort = 'created ' and @direction = 'up' then hide_created end asc
OFFSET @PageSize * (@Page - 1) ROWS
FETCH NEXT @PageSize ROWS ONLY;
 
Falcon Space is a functional web development platform on a narrow stack MS SQL/Bootstrap. Falcon Space Gettting started
{sp-shortDemostandLinks}

Falcon Space Platform

This is a reduction in the cost of ownership

at the expense of fewer people to support

This is a quick change

while using the program

This is a modern interface

full adaptation for mobile devices

Note