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

SQL Indexes question

LEGEND ,
Jun 11, 2007 Jun 11, 2007
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
309
Translate
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
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.
Translate
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
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.


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