SELECT * FROM project_table ORDER BY EmployeeName DESC;
I want to update my table with this query. Apparently this only shows the result. I want to update my table permanently with ORDER BY DESC
.
SELECT * FROM project_table ORDER BY EmployeeName DESC;
I want to update my table with this query. Apparently this only shows the result. I want to update my table permanently with ORDER BY DESC
.
Normaly you should not force a custom sort order on a table because that could impact performance. And in addtion sql server never guarantees you a sorted resultset except when you use ORDER BY ...
.
You could use a clustered index to force a custom sort order. But even that is not a guarantee that a SELECT * FROM table
will give you sorted result set.
But I would not recommend to use clustered indexes to do anything like that. clustered indexes are great to be able to join tables together in an efficient way.
If you need the data in sorted order you should build a table valued function that returs sorted order or build a stored procedure that returns a sorted result.