Unanswered: Appened records from Table A to Table B via Insert?
I tried to insert large pool of data from table A to table B. Table B is then exported to Excel for viewing purpose. However, i found that some of the rows are not inserted in order, they seemed to be inserted in between other rows that are inserted before them. May I know what is the problem? There is no key assigned to table B. Do we need to disable key in order to have items inserted in sequence order?
in other word, instead of "insert", can we "append" records?
"clustered index"? the data has a lot of duplicates and only certain rows are unique, mostly are duplicates. That's why I have problem defining the right key to it. I ever thought of using timestamp to be the index key, however, it is still not unique enough
let me make this clearer. It is actually a complicated rigid report. this is the structure of Table B:
There are different branches where employees belongs to, and I did a while loop to handle the branches one by one.
For each branch, it will actually fill up Table B with the following data:
Report XYZ <-- first row (inserted into Emp# and EmpName, with 7 and 50 nvarchar respectively)
Branch: <-- 2nd row (inserted into Emp# only)
EmpNo Emp Name 1/1 1/2 1/3 1/4 123 456 789 <-- 3rd row, the header of the data, inserted into various fields
1234567 John 8 4 6 2 1.05 2.05 3.05 <-- 4th row and subsequent rows under the same branch, indicating the detail data
and the 5th row onwards are the same detail data, until all data in the branch is published. in fact, the detail data was only processed by 1 single query, only the headers are being "inserted manually" 1 by 1.
I know it's a bit crazy to do it this way, unfortunately, my users are not ready for report servers, that's how I came out with this crazy idea and export them to excel for them to view it or print it out on hardcopy.
What went hairwire? Some of the headers appears after the actual data.
Do let me know if you have better suggestion In fact, there are a few more fields that are not directly related to the actual data to be included in the report. That's why it makes the whole report so complicated.