Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CommandBuilder vs Stored Proc for updating
Message
From
22/01/2010 11:11:15
John Baird
Coatesville, Pennsylvania, United States
 
General information
Forum:
ASP.NET
Category:
ADO.NET
Environment versions
Environment:
C# 2.0
Miscellaneous
Thread ID:
01445437
Message ID:
01445483
Views:
41
>>>>
>>>>Can you give us an idea of what you are trying to do? Maybe we can help..
>>>
>>>Say I have a dataset of one table with one row. And I need to create an UPDATE command to pass to a stored procedure. So far, in the book I am reading, I only found a way to do it by creating SQL parameter object and adding a parameter for each column that has been changed. And I don't know how to determine which columns have been change in a generic way. Does it make sense? TIA.
>>
>>Normally I would create an update SP that has parameters for all fields that could be updated, and pass those fields back whether they were updated or not. In general, that winds up being all fields for a table aside from the primary key.
>
>I understand. I will probably follow the same approach (if this is good enough for you, it will work for me too). Thank you.

IMO, this is an inefficient way to handle the situation. If only one field has changed, you would be sending all fields to the sp and updating all fields. With a diffgram, you only update what has actually changed.

http://msdn.microsoft.com/en-us/library/ms172088(VS.71).aspx
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform