Already sorted?

  • Is there a way to tell SQL Server that the data being loaded is already sorted?

  • Create clustered index to the table.

  • hi,

    taken directly from BOL,

    "For example, to bulk copy data from the Authors.txt data file to the authors2 table in the pubs database, specifying that the data file is in ascending order on the au_id column, execute from the command prompt:

    bcp pubs..authors2 in authors.txt -c -t, -Sservername -Usa -Ppassword -h "ORDER (au_id ASC)"

    Alternatively, you can use the BULK INSERT statement from a query tool, such as SQL Query Analyzer, to bulk copy data:

    BULK INSERT pubs..authors2 FROM 'c:\authors.txt'

    WITH (

    DATAFILETYPE = 'char',

    FIELDTERMINATOR = ',',

    ORDER (au_id ASC)

    )

    By default, the bulk copy operation assumes that the data file is unordered."

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply