select * from students iif(sortonname=true,order by name,order by city(default))
select * from students order by iif(sortonname=true, name, city)
sortonname
IF @SortOnName=0 SELECT * FROM students ORDER BY city ELSE SELECT * FROM students ORDER BY name
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)