Friday, February 24, 2012

How to delete and then add to the bottom of the list

Hi,

I have a record in the Database. I want to perform some functions on the record and then place that record at the end of list.

How can I achieve that ??are you trying to do this from a stored proc ? if so you can get the columnvalues into variables and then insert back into the db..

you can also use the "deleted" table to get the values...but there are some limitations i believe...you can check the documentation for using the deleted table..

HTH|||Data in SQL is, by definition, not sorted unless you specify how you want it sorted. So, if you want a record to be at the end of aset of records, you need to specify an ORDER BY that will put it at the end. If you always want the last record modified to be at the end, you might consider adding a LastModified datetime field to the table, putting in an UPDATE trigger that will set that field to the current date/time (calling GetDate will retrieve the current system date/time), and then have and ORDER BY LastModified on your SELECT command.

No comments:

Post a Comment