• deepkt (7/10/2013)


    Does there any possibility of fine tuning of my procedure to accommodate my requirement, I am stuck with the code.

    Please help..

    We are helping. You are refusing to be helped. I don't know why you think that you are stuck with the code. But to fix your current solution, we would need to know the client code as well - and, no thanks, I don't want to see it.

    Listen, we don't say these things out of thin air. I have tackled similar problems in the past the way you are trying to do, and I never got it work. There was always one more case. The only reasonable way is to send in all data in one go.

    If you really want to update rows one by one, starting with negating all sorter values, and the update each row one by one to the new order. But that's a very ineffecient solution which will kill you sooner or later. So be a good boy and change the code to use a TVP, and learn something you can use in the future.

    [font="Times New Roman"]Erland Sommarskog, SQL Server MVP, www.sommarskog.se[/font]