Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 truncate

Author  Topic 

sent_sara
Constraint Violating Yak Guru

377 Posts

Posted - 2010-03-25 : 19:07:22
hi whether truncating temp table will delete a index too?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-03-25 : 20:35:15
It doesn't drop the indexes, if that's what you mean. It deletes the data, so the index's data is gone too. The indexes still exist though.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

sent_sara
Constraint Violating Yak Guru

377 Posts

Posted - 2010-03-26 : 11:39:36
you mean the definition exists..index data alone truncated?

quote:
Originally posted by tkizer

It doesn't drop the indexes, if that's what you mean. It deletes the data, so the index's data is gone too. The indexes still exist though.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-03-26 : 11:56:13
Yes.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -