Tuesday, March 27, 2012

Do I need to Reindex after truncate table?

Hi All,
A quick question: Do I have to Reindex a table (using "DBCC DBREINDEX"
statement) AFTER I truncate a table? In SQL 2005 BOL it seems after
truncate table although the index(es) is still there but the data page
is 0.
Thank you for your help.
BobAfter truncating a table there is nothing to reindex. The index definitions
are still there and will apply to the new records.
Hope this helps,
Ben Nevarez
Senior Database Administrator
AIG SunAmerica
"dengcharles@.hotmail.com" wrote:

> Hi All,
> A quick question: Do I have to Reindex a table (using "DBCC DBREINDEX"
> statement) AFTER I truncate a table? In SQL 2005 BOL it seems after
> truncate table although the index(es) is still there but the data page
> is 0.
> Thank you for your help.
> Bob
>|||Regarding your statement that "index(es) is still there but the data page is
0" you can use sp_spaceused 'your_table' to verify that everything is 0
(rows, data, index, etc).
Hope this helps,
Ben Nevarez
Senior Database Administrator
AIG SunAmerica
"Ben Nevarez" wrote:
[vbcol=seagreen]
> After truncating a table there is nothing to reindex. The index definition
s
> are still there and will apply to the new records.
> Hope this helps,
> Ben Nevarez
> Senior Database Administrator
> AIG SunAmerica
>
> "dengcharles@.hotmail.com" wrote:
>

No comments:

Post a Comment