VentureFree
Well-known member
- Joined
- Jan 9, 2008
- Messages
- 54
- Programming Experience
- 5-10
Noob here. I've got a normalized database in SQL server comprised of about 7 separate tables. I'm needing to upsert (update if an entry exists, insert if it doesn't) into those tables. My (probably stupid) question is can I start and end a TRANSACTION in separate sql statements (that is to say multiple ExecuteNonQuery() calls) so that I can build each statement and run it before moving on to the next upsert, or do I need to build all of the individual sql statements and combine them into a single ';' delimited statement before running the single ExecuteNonQuery()?
Actually would it be considered more efficient, or maybe just safer, to go ahead and combine all the statements into one anyway?
Actually would it be considered more efficient, or maybe just safer, to go ahead and combine all the statements into one anyway?