SQL Server Performance

Row order

Discussion in 'SQL Server DTS-Related Questions' started by proul, Jul 5, 2005.

  1. proul New Member

    I need import data from excel file. The problem - after import by dts rows are not order as in excel file. I tried many ways but result is different. Rows aren't in order as in source file - always different and I need to keep the same order in the table as in the excel file, what can i do??

    Thanks for the help!!!
  2. Madhivanan Moderator

    Did you try to sort data in Excel?


    Madhivanan

    Failing to plan is Planning to fail
  3. dineshasanka Moderator

    Do you have any primary keys defined at the table

    I used DTS to transfer Orders table to excel file and it is transferred to excel file with the same order

  4. proul New Member

    First off all, i want transfer the excel file to a table.

    I cant't sort data because the data is distribuited in a specific way that a i have to manage the data in the same way to know where is the speceific data that I want.

    A sample of excel file:

    Ordernumber1 orderdescription1
    detailorder1 price1
    detailorder2 price2
    totalinletter total

    Ordernumber2 orderdescription2
    detailorder1 price1
    detailorder2 price2
    totalinletter total

    thanks for the help
  5. Madhivanan Moderator

  6. proul New Member

    I try openRowset and the same things happend.

    the first time that i try this the data pass in order, but the next time that i try the data don't pass in order. And i have to do this every week and i need the data be in order.
  7. Madhivanan Moderator

    quote:the first time that i try this the data pass in order, but the next time that i try the data don't pass in order.
    Next time, are you inserting the records to the same file by deleting the excel data?


    Madhivanan

    Failing to plan is Planning to fail
  8. proul New Member

    I'm transfering a excel file to a table.

    The next time, I delete the table to transfer the excel file.
  9. Madhivanan Moderator

    In the openRowset query, did you try to give order by


    Insert into SQLServerTable Select * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
    'Excel 8.0;Database=D: esting.xls;HDR=YES',
    'SELECT * FROM [SheetName$] order by col')


    Madhivanan

    Failing to plan is Planning to fail

Share This Page