Perform conditional bulk update in Linq to SQL -


I have a SQL table that stores photos with a small sort order field. Users can insert new photos, which specifies a decimal sort order to keep a new record between two existing photos (or before the first photo). The sort order will be stored as a small one, so when I think an insertion will move the existing record, then I need to update all the affected photos by increasing the sort order from 1.

It's easy to archive the process, but I'm looking for the most effective way to complete it with SQL from Linq. If I want to pull down all the records from the client, update them, and then submit them, then I will be with the stored procedure only which is already working and very fast.

Here T-SQL changes the records:

  Photo ST sortorder = sort order + 1 where album id = @bubbyID and sort order & gt; = CEILING (@SortOrder)  

Is there a way to make this kind of bulk update without Linux records in Linux?

The CUD does not state statement from SQL for SQL set, so stick to your existing implementation because it The best in your scenario.


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -