sql server - How to insert an item in a database and sort again -
suppose have database primarykey id , varchar name, , need data ordered id.
so data is
- james
- jhon
- patrick
and on
and want insert row in second row
- james
- lee
- john
- patrick
how can it?
do have update rows after "lee" , change id?
is there simpler way keep order?
thank you. learn here lot
why want "insert row in second row"? doing indeed require update other records, , should not changing primary key values of records. changing them require updates in tables have foreign keys referring table.
let database handle primary keys. if need number sort of priority or sorting purposes, suggest separate column that.
Comments
Post a Comment