deepkt (7/10/2013)
Thanks for the reply.In UI I am binding data to a grid.. all the logic will be processed using stored proc and from back end.
In UI user will modify Displayorder of his interest and it will be passed to SP and need to process it.
If multiple updates are there then multiple times proc will be called. I am fine with Multiple calls to database.
And that's where your problems start. I suggested using a TVP for two reasons:
With the solution I suggest, the stored procedure is dirt simple: it's a single update from the TVP. Well, maybe a single MERGE statement as the user may add or delete rows as well. You need to some more work in the client - but not a lot. I don't know anything about grid-binding, but I assume that you can bind a DataTable to the grid, and you can pass a DataTable to a TVP.
[font="Times New Roman"]Erland Sommarskog, SQL Server MVP, www.sommarskog.se[/font]