Re: C# transactions v SQL transactions
From: Scott Allen (bitmask_at_[nospam)
Date: 09/23/04
- Next message: Steve Ng: "System.Net.CredentialCache.DefaultCredentials are blank"
- Previous message: David Meier: "Case-sensitive file name returned from FileSystemWatcher?"
- In reply to: Mike P: "C# transactions v SQL transactions"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 23 Sep 2004 11:12:11 -0400
Hi mrp:
As other have commented, error handling in stored procs is very
difficult to do - it tends to clutter up the TSQL quite a bit and it's
terribly easy to overlook a problem. It's an approach I try to avoid.
SQL 2005 has some improvements, but that's not here, and if you are
concerened about portability at all its not an option.
-- Scott http://www.OdeToCode.com On Thu, 23 Sep 2004 06:44:40 -0700, Mike P <mrp@telcoelectronics.co.uk> wrote: >I've been using C# transactions for a while and had no problems with >them. Using try catch blocks I can trap basically all possible errors >and rollback all necessary data. > >Over the last few days I've been trying to convert some of this code to >SQL Server stored procedures, but it seems to lack many of the benefits >of C# transactions - a lot of the errors don't seem to be trapped by the >SQL error trapping (e.g. if I do an update on a row that doesn't exist, >no rollback occurs and execution continues, if a table I am trying to >access doesn't exist then the sproc crashes). > >Can anybody tell me what reasons there are for writing your transactions >in stored procedures rather than your .NET code, as there don't seem to >be any to me. > > >Any assistance would be really appreciated. > > >Cheers, > >Mike > > >*** Sent via Developersdex http://www.developersdex.com *** >Don't just participate in USENET...get rewarded for it!
- Next message: Steve Ng: "System.Net.CredentialCache.DefaultCredentials are blank"
- Previous message: David Meier: "Case-sensitive file name returned from FileSystemWatcher?"
- In reply to: Mike P: "C# transactions v SQL transactions"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|