News

I want to set up a stored procedure where the data is ordered by column according to user input, i.e.GetSomeData(@SearchPhrase varchar(80), @SortCode int) ASSELECT Field1, Field2, Field3 FROM tbl ...
To do this in MS SQL Server, add the following to the beginning of your column selection: ROW_NUMBER () OVER ( ORDER BY b.Id) as NID which alters the example view to: ...