Dynamically sorting by a column in a Stored Procedure (SQL Server)
Have you ever needed to build a stored procedure that would take the name of a column as a parameter, and return the results ordered by that column? So have…
Have you ever needed to build a stored procedure that would take the name of a column as a parameter, and return the results ordered by that column? So have…
I've had this problem a few times, and many people always ask me it... so here it is immortalised. If you require to select all records added to your table…