May 26, 2015 at 9:46 pm
Hi,
which ALTER TABLE/ALTER COLUMN- Statement has a Recreate Table as result ?
Thanks and Regards
Nicole
May 27, 2015 at 1:26 am
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
May 27, 2015 at 2:28 am
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
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply