|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi,
I have a problem with inserting data into SQL tables. So far, everything that is entered into my form does get inserted correctly, meaning all data is added successfully to their respective columns. However, sometimes when I insert another set of data, it appears on top of the preceding data. The Third column in my table is called 'Receipt no', is coded to increment each time by one. Example: (first entry) Bank_code Cheque_no Receipt no amt_receipted total_cheque 1 100 100 (next entry) : 2 inserted on top of 1 Bank_code Cheque_no Receipt no amt_receipted total_cheque 2 200 300 1 100 <NULL> (next entry again) Bank_code Cheque_no Receipt no amt_receipted total_cheque 2 200 <NULL> 1 100 <NULL> 3 150 <NULL> - (3 rd row inserted below 1) This particular program has a certain logic whereby, whenever a record is inserted, the total_cheque value of the previous record present , becomes <NULL> and the gives the total value of the cheques in the current record total_cheque column. But since the order is changed, it gives a <NULL> value for the total_cheque which should not happen. Can anyone kindly help me in simulating this incorrect order so as to make sure, the NULL value occurence is only due to this incorrect ordering? or can there be any other reason that makes this happen?? Thanks in advance. Last edited by s_vidya03 : November 14th, 2003 at 03:53 AM. |
|
#2
|
|||
|
|||
|
try adding an index to the table
|
|
#3
|
|||
|
|||
|
Thanks for the suggestion.
we have decided to use Indexing to solve the problem. |
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > Help me simulate the ordering. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|