Truncate vs index

  • hi,

      I am truncating a table and doing bulk insertion. My doubt here is On truncating the table what happens to the Indexes.. whether it removes all the entries in the clustered index? And after the bulk insertion, if i rebuild the clustered index , does it make sense ?

    Thanks in advance

    nsr

     

     

     

  • the index info is dropped as well, so the indexex add new values with your inserts:

    from BOL: TRUNCATE TABLE immediately frees all the space occupied by that table's data and indexes. The distribution pages for all indexes are also freed.

    As with DELETE, the definition of a table emptied using TRUNCATE TABLE remains in the database, along with its indexes and other associated objects. The DROP TABLE statement must be used to drop the definition of the table.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

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

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