Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
bfoster
Starting Member
30 Posts |
Posted - 2008-06-09 : 12:02:45
|
| We have transaction table, and we want to make sure that when we query the balance in an account that another process isn't able to enter a transaction on the same account until we are done with our transaction.This is a simplified version of the current code:BEGIN TRANSACTIONSELECT @CurrentBalance = dbo.GetAccountBalanceAsOfDate(@AccountId, GETDATE())IF (@Debit <= @CurrentBalance)BEGININSERT INTO dbo.Transactions() VALUES()ENDCOMMIT TRANSACTION |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-06-09 : 13:52:45
|
| Read about transaction isolation levels in books online |
 |
|
|
|
|
|