Alter Table triggers Recreate Table ?

  • Hi,

    which ALTER TABLE/ALTER COLUMN- Statement has a Recreate Table as result ?

    Thanks and Regards

    Nicole

  • Looks like an interview question.

    If "recreate table" means that all the data is reinserted in the table, the possible answers are:

    ALTER TABLE SomeTable REBUILD; -- Rebuilds a heap table

    ALTER INDEX SomeClusteredIndex ON SomeTable REBUILD; -- Rebuilds a clustered index

    -- Gianluca Sartori

  • ALTER TABLE ... ALTER COLUMN doesn't recreate the table. It changes a single column.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

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

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