Create new table from old table and rebuild its indexes

osql -U sa

password: *****

1. Insert into already created table.

use <name-of-database>

insert into EQcust (*) select * from EQCUSTTemp;
go

2. Insert into a new table ( replicate a table)

use <name-of-database>

SELECT *
INTO EQtest
FROM EQCUSTTemp

3. Rebuild index online
use <name-of-database>

ALTER INDEX ALL ON EQCUSTTemp
REBUILD WITH(ONLINE = ON)

Leave a comment