newbie question up multi-table update

  • Thread starter Thread starter GS
  • Start date Start date
G

GS

I am using VS 2007 express Sp1 dotnet 2

what is the best way to deal with multi-table update/add?

I found an example of using TransactionScope with a couple of database
connection. DO I have to use one connection per table even if the tables
belong to one single database?
Can TransactionScope be used to sql express 2005 file?
 
TransactionScope will work with SQL Server 2005.

As far as multi-table updates/adds, you can use the same connection in
the transaction if you want, assuming you have access to it. If you don't
(because of class design, for example), you can fire up a new connection,
and as long as the call stack is wrapped in a TransactionScope, it will be
included in the current transaction that is active on the thread.

Hope this helps.
 
There are a lot of ways to "skin a cat" so to speak, but my take on this is
to handle multi-table insert - update functionality via stored procedures
where the business logic is handled in the database itself, wrapped in
appropriate transaction constraints.

Developers often miss the mark in not understanding how the database can
handle sophisticated business logic a lot "closer to the metal" than in the
C# calling code, and do so more efficiently.
Peter
 
undoubtedly there are advantages in using stored procedure esp. in business
logic in terms of speed....


that would be good if all business logic were possible in the database.
Currently the project has some business log that is not embeddable in
database. At least I don't know how to get all in database and still
finish on time.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top