Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Your thoughts please
Message
General information
Forum:
ASP.NET
Category:
ADO.NET
Environment versions
Environment:
C# 1.1
Database:
MS SQL Server
Miscellaneous
Thread ID:
01075336
Message ID:
01075432
Views:
14
Hi, Einar,

I use a stored proc, but I do it all in one round trip. Let's say I have a stored proc for adding/updating a simple name table.

I'll pass the values as parms.....@NamePK int = null, @FirstName, @LastName

If the @NamePK was not passed ("insert mode"), I'll issue an insert statement, and then do a scope_identity to get the value of the PK that was assigned.

IF the @NamePK was passed, I'll issue an update statement based on the @NamePK.

Hope that helps...
Kevin
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform