I have a table in SQL server with two columns, Name and Order. Name is a varchar column which contains student names, Order is an int column which contains the number in ascending order corresponding to the Name column in alphabetical order.
For example, the expected result should be like below
Names - Order
ABC - 2
AAA - 1
CCC - 3
XZZ - 5
XYZ - 4
Is there any option to generate the order column automatically whenever a new name gets inserted into the table?