If I'm already using transactions in my stored procedure, is it feasible to use transactions in VS 2008 to call the procedure multiple times?
What I am trying to do is re-use my insert single record stored procedure which already uaes transactions. I want to insert multiple records using this insert single record stored procedure, a开发者_高级运维nd rollback if exceptions happen.
I have a feeling that this is not best practice, and I suspect it may cause problems.
Any ideas?
It is possible, but most of the time would be round-trips to the database server.
Suggestions:
- load temp table, call stored proc on same connection
- use XML/Table parameter on stored proc
- Batch the stored proc calls (which means submitting a big string)
精彩评论