Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

SQL Indexes question

LEGEND ,
Jun 11, 2007 Jun 11, 2007

Copy link to clipboard

Copied

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?


TOPICS
Server side applications

Views

308
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 11, 2007 Jun 11, 2007

Copy link to clipboard

Copied

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.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 11, 2007 Jun 11, 2007

Copy link to clipboard

Copied

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.


Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 11, 2007 Jun 11, 2007

Copy link to clipboard

Copied

LATEST
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.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines