|
Home > Archive > microsoft.public.sqlserver.server > October 2002 > Double record
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| David Cheng 2002-10-28, 8:23 pm |
| Hi! I am desperate for help.
Scenario
OS - Windows 2000 Adv Server
DATABASE - SQL Server 2000
Clients OS - Windows 2000 Pro
Number of Clients - 10
Problem
Whenever a new transaction takes place, a new number is
generated, but sometimes the second transactions
information will jump into the first transactions.
In other words, two accounts with the same invoice number.
I have tried asking many people on how to solve this
problem but to no avail. Ironically, the total for the
first invoice is the same.
That is to say when one's deposit money, it does not goes
into your own account but into someone's else.
It happends quite frequently say an average tow to three
times per day.
someone please help me. i am about to go nuts.
| |
| Russell Fields 2002-10-28, 9:23 pm |
| David,
There is not enough information to know the answer, but there is enough
there to be sure that it is an application problem. Transactions will not
interleave their data, that is what transactions are about. It seems most
likely that what you consider a transaction from the user's point of view is
bigger than what SQL Server is considering to be a transaction. For
example:
Your method of getting the next invoice number is not transactionally
preventing another transaction from getting the same invoice number. If
this is the case, possible workarounds are:
a. Use an Identity column if that fits your need.
b. Don't use MAX(column) + 1
c. If you are getting the number from a NextNumber table you could lock in
your number by, beginning a transaction, updating the number to itself + 1
(or whatever), selecting that number for your invoice, ending that
transaction. Then begin a transaction for the creation of your invoice.
Other confusions could result from using triggers to do the transaction (a
practice for some Access frontends) without taking concurrency into
consideration.
Hope that helps,
Russell Fields
"David Cheng" <ctauto@tm.net.my> wrote in message
news:47d701c27eef$4ec45b50$35e
f2ecf@TKMSFTNGXA11...
Hi! I am desperate for help.
Scenario
OS - Windows 2000 Adv Server
DATABASE - SQL Server 2000
Clients OS - Windows 2000 Pro
Number of Clients - 10
Problem
Whenever a new transaction takes place, a new number is
generated, but sometimes the second transactions
information will jump into the first transactions.
In other words, two accounts with the same invoice number.
I have tried asking many people on how to solve this
problem but to no avail. Ironically, the total for the
first invoice is the same.
That is to say when one's deposit money, it does not goes
into your own account but into someone's else.
It happends quite frequently say an average tow to three
times per day.
someone please help me. i am about to go nuts.
| |
| Steven Wilmot 2002-10-31, 7:23 pm |
| The one important thing you fail to mention here is how you are generating
the new invoice number.
"David Cheng" <ctauto@tm.net.my> wrote in message
news:47d701c27eef$4ec45b50$35e
f2ecf@TKMSFTNGXA11...
> Hi! I am desperate for help.
> Scenario
> OS - Windows 2000 Adv Server
> DATABASE - SQL Server 2000
> Clients OS - Windows 2000 Pro
> Number of Clients - 10
>
> Problem
> Whenever a new transaction takes place, a new number is
> generated, but sometimes the second transactions
> information will jump into the first transactions.
> In other words, two accounts with the same invoice number.
> I have tried asking many people on how to solve this
> problem but to no avail. Ironically, the total for the
> first invoice is the same.
>
> That is to say when one's deposit money, it does not goes
> into your own account but into someone's else.
> It happends quite frequently say an average tow to three
> times per day.
>
> someone please help me. i am about to go nuts.
>
>
|
|
|
|
|