Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
YAQ on BIZ and DA tiers
Message
From
30/08/2009 13:32:43
 
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 2.0
Miscellaneous
Thread ID:
01419401
Message ID:
01421752
Views:
46
I'm trying to figure out why one would need to do an INSERT and UPDATE in one line of code. The same table?

You might have two tables, Table A and Table B. You want to do a "selective syncrhonization"....if certain rows exist in B but not in A....you want to insert those rows from B to A.....and if certain rows exist in both, you might want to update certain columns from B to A. That's just one of several possibilities.

The MERGE in 2008 also has a DELETE section....so you "can" do an INSERT/UPDATE/DELETE in 1 line of code, though doing all 3 can result in a rather complex statement.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform