Skip to main content
Inspiring
June 11, 2007
Question

SQL Indexes question

  • June 11, 2007
  • 3 replies
  • 325 views
If I have created several Indexes in SQL Server 2000, and then as part of an
overnight proccess the table that the Indexes are built on is dropped and
recreated, will the Indexes also be dropped and need to be re-created?


This topic has been closed for replies.

3 replies

Inspiring
June 11, 2007
IanH wrote:

> Thanks, so a TRUNCATE instead would not drop the Indexes?
>
From what I have read, that is correct. However, if you are
repoplulating the table beware that indeices can slow down the process
a lot. In the past when we wanted to repopulate a table we would just
drop it, recoreate it, populate it, and then apply the indecies. It
was quicker but it was not on a production server. Someone else needs
to weight in on that.
Inspiring
June 11, 2007
Thanks, so a TRUNCATE instead would not drop the Indexes?


"Philo" <meansyou@nospam.net> wrote in message
news:f4jd5r$4qm$1@forums.macromedia.com...
> If you drop a table, it is gone. Therefore when you recreate the
> table, you will have to recreate the indexes. You can use enterprise
> manager to create the script. For example, right click on table foo,
> select Generate SQL Script. Be sure to go to the options tab and
> script indexes.


Inspiring
June 11, 2007
If you drop a table, it is gone. Therefore when you recreate the
table, you will have to recreate the indexes. You can use enterprise
manager to create the script. For example, right click on table foo,
select Generate SQL Script. Be sure to go to the options tab and
script indexes.