I have a stored procedure that does both the insert and the update in one fell swoop (if the id == 0 then it's an insert, otherwise, update). I'd love to use this for both the insert and the update methods in Entity Framework, but this isn't looking feasible. Am I correct that I'll have to split the methods into two different stored procedures, or is there a way around this?
views:
103answers:
1
+2
A:
On way I would try first, is opening the EDMX in the XML editor and finding the sproc (Function) in the StorageModel element, copy it, giving it a new name.
Then you can map one actual stored procedure twice once as the Insert Modification function once as the Update Modification function.
I haven't actually tried this, but I can't see why this won't work.
Hope this helps
Alex James, Program Manager, Microsoft
Alex James
2009-10-12 16:33:17
I haven't tried it either, but I agree, it should work. I just wound up re-writing the sprocs.
MasterMax1313
2010-03-23 02:43:12